[Libreoffice-commits] .: sd/source

Ivan Timofeev ivantimofeev at kemper.freedesktop.org
Wed Feb 1 08:03:21 PST 2012


 sd/source/core/drawdoc3.cxx                       |   10 
 sd/source/ui/app/sdxfer.cxx                       |   10 
 sd/source/ui/dlg/LayerTabBar.cxx                  |   20 -
 sd/source/ui/dlg/animobjs.cxx                     |    2 
 sd/source/ui/dlg/copydlg.cxx                      |    2 
 sd/source/ui/dlg/dlgolbul.cxx                     |    4 
 sd/source/ui/dlg/dlgsnap.cxx                      |    4 
 sd/source/ui/inc/OutlineView.hxx                  |   12 
 sd/source/ui/inc/View.hxx                         |   10 
 sd/source/ui/inc/slideshow.hxx                    |    1 
 sd/source/ui/slideshow/slideshow.cxx              |   10 
 sd/source/ui/slidesorter/view/SlideSorterView.cxx |    2 
 sd/source/ui/view/ViewClipboard.cxx               |   20 -
 sd/source/ui/view/drawview.cxx                    |   16 
 sd/source/ui/view/drbezob.cxx                     |    2 
 sd/source/ui/view/drtxtob.cxx                     |   22 -
 sd/source/ui/view/drtxtob1.cxx                    |   12 
 sd/source/ui/view/outlnvsh.cxx                    |    2 
 sd/source/ui/view/outlview.cxx                    |  393 ++++++++++------------
 sd/source/ui/view/sdview.cxx                      |   36 +-
 sd/source/ui/view/sdview2.cxx                     |   32 -
 sd/source/ui/view/sdview3.cxx                     |   30 -
 sd/source/ui/view/sdview4.cxx                     |   10 
 23 files changed, 327 insertions(+), 335 deletions(-)

New commits:
commit bc8fa08a7ae48f68ee5578cb7820336c70898202
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Wed Feb 1 19:58:05 2012 +0400

    pointer -> reference

diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index c05af48..c434c2f 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1007,7 +1007,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsObject(
 
     if (!pBookmarkList)
     {
-        pBMView = new ::sd::View(pBookmarkDoc, (OutputDevice*) NULL);
+        pBMView = new ::sd::View(*pBookmarkDoc, (OutputDevice*) NULL);
         pBMView->EndListening(*pBookmarkDoc);
         pBMView->MarkAll();
     }
@@ -1038,7 +1038,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsObject(
                 if (!pBMView)
                 {
                     // View erstmalig erzeugen
-                    pBMView = new ::sd::View(pBookmarkDoc, (OutputDevice*) NULL);
+                    pBMView = new ::sd::View(*pBookmarkDoc, (OutputDevice*) NULL);
                     pBMView->EndListening(*pBookmarkDoc);
                 }
 
@@ -1065,7 +1065,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsObject(
         /**********************************************************************
         * Selektierte Objekte einfuegen
         **********************************************************************/
-        ::sd::View* pView = new ::sd::View(this, (OutputDevice*) NULL);
+        ::sd::View* pView = new ::sd::View(*this, (OutputDevice*) NULL);
         pView->EndListening(*this);
 
         // Seite bestimmen, auf der die Objekte eingefuegt werden sollen
@@ -1112,13 +1112,13 @@ sal_Bool SdDrawDocument::InsertBookmarkAsObject(
         }
 
         if (bOLEObjFound)
-            pBMView->GetDoc()->SetAllocDocSh(sal_True);
+            pBMView->GetDoc().SetAllocDocSh(sal_True);
 
         SdDrawDocument* pTmpDoc = (SdDrawDocument*) pBMView->GetAllMarkedModel();
         bOK = pView->Paste(*pTmpDoc, aObjPos, pPage);
 
         if (bOLEObjFound)
-            pBMView->GetDoc()->SetAllocDocSh(sal_False);
+            pBMView->GetDoc().SetAllocDocSh(sal_False);
 
         if (!bOLEObjFound)
             delete pTmpDoc;             // Wird ansonsten von der DocShell zerstoert
diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx
index fe56d11..009a1b4 100644
--- a/sd/source/ui/app/sdxfer.cxx
+++ b/sd/source/ui/app/sdxfer.cxx
@@ -282,7 +282,7 @@ void SdTransferable::CreateData()
 
         mpVDev = new VirtualDevice( *Application::GetDefaultDevice() );
         mpVDev->SetMapMode( MapMode( mpSdDrawDocumentIntern->GetScaleUnit(), Point(), mpSdDrawDocumentIntern->GetScaleFraction(), mpSdDrawDocumentIntern->GetScaleFraction() ) );
-        mpSdViewIntern = new ::sd::View( mpSdDrawDocumentIntern, mpVDev );
+        mpSdViewIntern = new ::sd::View( *mpSdDrawDocumentIntern, mpVDev );
         mpSdViewIntern->EndListening(*mpSdDrawDocumentIntern );
         mpSdViewIntern->hideMarkHandles();
         SdrPageView* pPageView = mpSdViewIntern->ShowSdrPage(pPage);
@@ -518,12 +518,10 @@ sal_Bool SdTransferable::GetData( const DataFlavor& rFlavor )
 
             if( mpSdViewIntern )
             {
-                SdDrawDocument* pInternDoc = mpSdViewIntern->GetDoc();
-                if( pInternDoc )
-                    pInternDoc->CreatingDataObj(this);
+                SdDrawDocument& rInternDoc = mpSdViewIntern->GetDoc();
+                rInternDoc.CreatingDataObj(this);
                 SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( mpSdViewIntern->GetAllMarkedModel() );
-                if( pInternDoc )
-                    pInternDoc->CreatingDataObj(0);
+                rInternDoc.CreatingDataObj(0);
 
                 bOK = SetObject( pDoc, SDTRANSFER_OBJECTTYPE_DRAWMODEL, rFlavor );
 
diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx
index 0828437..8038402 100644
--- a/sd/source/ui/dlg/LayerTabBar.cxx
+++ b/sd/source/ui/dlg/LayerTabBar.cxx
@@ -161,7 +161,8 @@ sal_Int8 LayerTabBar::AcceptDrop( const AcceptDropEvent& rEvt )
     {
         sal_uInt16          nPageId = SDRPAGE_NOTFOUND;
         Point           aPos( PixelToLogic( rEvt.maPosPixel ) );
-        sal_uInt16          nLayerId = pDrViewSh->GetView()->GetDoc()->GetLayerAdmin().GetLayerID( GetPageText( GetPageId( aPos ) ), sal_False );
+        sal_uInt16 nLayerId = pDrViewSh->GetView()->GetDoc().GetLayerAdmin().GetLayerID(
+            GetPageText( GetPageId( aPos ) ), sal_False );
 
         nRet = pDrViewSh->AcceptDrop( rEvt, *this, NULL, nPageId, nLayerId );
 
@@ -180,7 +181,8 @@ sal_Int8 LayerTabBar::AcceptDrop( const AcceptDropEvent& rEvt )
 sal_Int8 LayerTabBar::ExecuteDrop( const ExecuteDropEvent& rEvt )
 {
     sal_uInt16          nPageId = SDRPAGE_NOTFOUND;
-    sal_uInt16          nLayerId = pDrViewSh->GetView()->GetDoc()->GetLayerAdmin().GetLayerID( GetPageText( GetPageId( PixelToLogic( rEvt.maPosPixel ) ) ), sal_False );
+    sal_uInt16 nLayerId = pDrViewSh->GetView()->GetDoc().GetLayerAdmin().GetLayerID(
+        GetPageText( GetPageId( PixelToLogic( rEvt.maPosPixel ) ) ), sal_False );
     sal_Int8        nRet = pDrViewSh->ExecuteDrop( rEvt, *this, NULL, nPageId, nLayerId );
 
     EndSwitchPage();
@@ -234,9 +236,9 @@ long LayerTabBar::AllowRenaming()
 
     // Ueberpruefung auf schon vorhandene Namen
     ::sd::View* pView = pDrViewSh->GetView();
-    SdDrawDocument* pDoc = pView->GetDoc();
+    SdDrawDocument& rDoc = pView->GetDoc();
     String aLayerName = pView->GetActiveLayer();
-    SdrLayerAdmin& rLayerAdmin = pDoc->GetLayerAdmin();
+    SdrLayerAdmin& rLayerAdmin = rDoc.GetLayerAdmin();
     String aNewName( GetEditText() );
 
     if ( aNewName.Len() == 0 ||
@@ -276,9 +278,9 @@ void LayerTabBar::EndRenaming()
         ::sd::View* pView = pDrViewSh->GetView();
         DrawView* pDrView = PTR_CAST( DrawView, pView );
 
-        SdDrawDocument* pDoc = pView->GetDoc();
+        SdDrawDocument& rDoc = pView->GetDoc();
         String aLayerName = pView->GetActiveLayer();
-        SdrLayerAdmin& rLayerAdmin = pDoc->GetLayerAdmin();
+        SdrLayerAdmin& rLayerAdmin = rDoc.GetLayerAdmin();
         SdrLayer* pLayer = rLayerAdmin.GetLayer(aLayerName, sal_False);
 
         if (pLayer)
@@ -288,9 +290,9 @@ void LayerTabBar::EndRenaming()
             DBG_ASSERT( pDrView, "Rename layer undo action is only working with a SdDrawView" );
             if( pDrView )
             {
-                ::svl::IUndoManager* pManager = pDoc->GetDocSh()->GetUndoManager();
+                ::svl::IUndoManager* pManager = rDoc.GetDocSh()->GetUndoManager();
                 SdLayerModifyUndoAction* pAction = new SdLayerModifyUndoAction(
-                    pDoc,
+                    &rDoc,
                     pLayer,
                     aLayerName,
                     pLayer->GetTitle(),
@@ -313,7 +315,7 @@ void LayerTabBar::EndRenaming()
             // schon bekannt sein muss.
             pView->SetActiveLayer(aNewName);
             pLayer->SetName(aNewName);
-            pDoc->SetChanged(sal_True);
+            rDoc.SetChanged(sal_True);
         }
     }
 }
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx
index 5943f12..7d07332 100644
--- a/sd/source/ui/dlg/animobjs.cxx
+++ b/sd/source/ui/dlg/animobjs.cxx
@@ -886,7 +886,7 @@ void AnimationWindow::AddObj (::sd::View& rView )
         {
             SdrMark*            pMark = rMarkList.GetMark(0);
             SdrObject*          pObject = pMark->GetMarkedSdrObj();
-            SdAnimationInfo*    pAnimInfo = rView.GetDoc()->GetAnimationInfo( pObject );
+            SdAnimationInfo*    pAnimInfo = rView.GetDoc().GetAnimationInfo( pObject );
             sal_uInt32              nInv = pObject->GetObjInventor();
             sal_uInt16              nId = pObject->GetObjIdentifier();
 
diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx
index 0b20b05..63708e8 100644
--- a/sd/source/ui/dlg/copydlg.cxx
+++ b/sd/source/ui/dlg/copydlg.cxx
@@ -95,7 +95,7 @@ CopyDlg::CopyDlg(
       maBtnSetDefault      ( this, SdResId( BTN_SET_DEFAULT ) ),
       mrOutAttrs           ( rInAttrs ),
       mpColorList          ( pColList ),
-      maUIScale(pInView->GetDoc()->GetUIScale()),
+      maUIScale(pInView->GetDoc().GetUIScale()),
       mpView               ( pInView )
 {
     FreeResource();
diff --git a/sd/source/ui/dlg/dlgolbul.cxx b/sd/source/ui/dlg/dlgolbul.cxx
index 75fa828..8f18a7f 100644
--- a/sd/source/ui/dlg/dlgolbul.cxx
+++ b/sd/source/ui/dlg/dlgolbul.cxx
@@ -171,7 +171,7 @@ void OutlineBulletDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
         {
             if( pSdView )
             {
-                FieldUnit eMetric = pSdView->GetDoc()->GetUIUnit();
+                FieldUnit eMetric = pSdView->GetDoc().GetUIUnit();
                 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
                 aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM,(sal_uInt16)eMetric));
                 rPage.PageCreated(aSet);
@@ -182,7 +182,7 @@ void OutlineBulletDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
         {
             if( pSdView )
             {
-                FieldUnit eMetric = pSdView->GetDoc()->GetUIUnit();
+                FieldUnit eMetric = pSdView->GetDoc().GetUIUnit();
                 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
                 aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM,(sal_uInt16)eMetric));
                 rPage.PageCreated(aSet);
diff --git a/sd/source/ui/dlg/dlgsnap.cxx b/sd/source/ui/dlg/dlgsnap.cxx
index 063be73..bf2ec14 100644
--- a/sd/source/ui/dlg/dlgsnap.cxx
+++ b/sd/source/ui/dlg/dlgsnap.cxx
@@ -69,8 +69,8 @@ SdSnapLineDlg::SdSnapLineDlg(
       aBtnCancel  (this, SdResId(BTN_CANCEL)),
       aBtnHelp    (this, SdResId(BTN_HELP)),
       aBtnDelete  (this, SdResId(BTN_DELETE)),
-      eUIUnit(pView->GetDoc()->GetUIUnit()),
-      aUIScale(pView->GetDoc()->GetUIScale())
+      eUIUnit(pView->GetDoc().GetUIUnit()),
+      aUIScale(pView->GetDoc().GetUIScale())
 {
     FreeResource();
 
diff --git a/sd/source/ui/inc/OutlineView.hxx b/sd/source/ui/inc/OutlineView.hxx
index c9bc27e..82eba37 100644
--- a/sd/source/ui/inc/OutlineView.hxx
+++ b/sd/source/ui/inc/OutlineView.hxx
@@ -67,9 +67,9 @@ class OutlineView
 {
     friend class OutlineViewModelChangeGuard;
 public:
-    OutlineView (DrawDocShell* pDocSh,
+    OutlineView (DrawDocShell& rDocSh,
         ::Window* pWindow,
-        OutlineViewShell* pOutlineViewSh);
+        OutlineViewShell& rOutlineViewSh);
     ~OutlineView (void);
 
     /** This method is called by the view shell that owns the view to tell
@@ -92,13 +92,13 @@ public:
     virtual void DeleteWindowFromPaintView(OutputDevice* pWin);
 
     OutlinerView*   GetViewByWindow (::Window* pWin) const;
-    SdrOutliner*    GetOutliner() { return(mpOutliner) ; }
+    SdrOutliner*    GetOutliner() { return(&mrOutliner) ; }
 
     Paragraph*      GetPrevTitle(const Paragraph* pPara);
     Paragraph*      GetNextTitle(const Paragraph* pPara);
     SdPage*         GetActualPage();
     SdPage*         GetPageForParagraph( Paragraph* pPara );
-    Paragraph*      GetParagraphForPage( ::Outliner* pOutl, SdPage* pPage );
+    Paragraph*      GetParagraphForPage( ::Outliner& rOutl, SdPage* pPage );
 
     /** selects the paragraph for the given page at the outliner view*/
     void            SetActualPage( SdPage* pActual );
@@ -187,8 +187,8 @@ private:
     /** updates all changes in the outliner model to the draw model */
     void UpdateDocument();
 
-    OutlineViewShell*   mpOutlineViewShell;
-    SdrOutliner*        mpOutliner;
+    OutlineViewShell&   mrOutlineViewShell;
+    SdrOutliner&        mrOutliner;
     OutlinerView*       mpOutlinerView[MAX_OUTLINERVIEWS];
 
     std::vector<Paragraph*> maOldParaOrder;
diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx
index 6816ef6..bbad2c5 100644
--- a/sd/source/ui/inc/View.hxx
+++ b/sd/source/ui/inc/View.hxx
@@ -80,7 +80,7 @@ public:
     TYPEINFO();
 
     View (
-        SdDrawDocument* pDrawDoc,
+        SdDrawDocument& rDrawDoc,
         OutputDevice* pOutDev,
         ViewShell* pViewSh=NULL);
     virtual ~View (void);
@@ -126,7 +126,7 @@ public:
     void                    UpdateSelectionClipboard( sal_Bool bForceDeselect );
 
     inline DrawDocShell* GetDocSh (void) const;
-    inline SdDrawDocument* GetDoc (void) const;
+    inline SdDrawDocument& GetDoc (void) const;
     inline ViewShell* GetViewShell (void) const;
 
     virtual sal_Bool SdrBeginTextEdit(SdrObject* pObj, SdrPageView* pPV = 0L, ::Window* pWin = 0L, sal_Bool bIsNewObj = sal_False,
@@ -214,7 +214,7 @@ protected:
     virtual void OnBeginPasteOrDrop( PasteOrDropInfos* pInfos );
     virtual void OnEndPasteOrDrop( PasteOrDropInfos* pInfos );
 
-    SdDrawDocument*         mpDoc;
+    SdDrawDocument&         mrDoc;
     DrawDocShell*           mpDocSh;
     ViewShell*              mpViewSh;
     SdrMarkList*            mpDragSrcMarkList;
@@ -247,9 +247,9 @@ DrawDocShell* View::GetDocSh (void) const
 {
     return mpDocSh;
 }
-SdDrawDocument* View::GetDoc (void) const
+SdDrawDocument& View::GetDoc (void) const
 {
-    return mpDoc;
+    return mrDoc;
 }
 
 ViewShell* View::GetViewShell (void) const
diff --git a/sd/source/ui/inc/slideshow.hxx b/sd/source/ui/inc/slideshow.hxx
index 486b402..7a050e7 100644
--- a/sd/source/ui/inc/slideshow.hxx
+++ b/sd/source/ui/inc/slideshow.hxx
@@ -104,6 +104,7 @@ public:
 
     // static helper api
     static rtl::Reference< SlideShow > GetSlideShow( SdDrawDocument* pDocument );
+    static rtl::Reference< SlideShow > GetSlideShow( SdDrawDocument& rDocument );
     static rtl::Reference< SlideShow > GetSlideShow( ViewShellBase& rBase );
 
     static ::com::sun::star::uno::Reference< ::com::sun::star::presentation::XSlideShowController > GetSlideShowController(ViewShellBase& rBase );
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index ca480f5..7c3fb09 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -182,13 +182,21 @@ rtl::Reference< SlideShow > SlideShow::GetSlideShow( SdDrawDocument* pDocument )
     rtl::Reference< SlideShow > xRet;
 
     if( pDocument )
-        xRet = rtl::Reference< SlideShow >( dynamic_cast< SlideShow* >( pDocument->getPresentation().get() ) );
+        xRet = GetSlideShow( *pDocument );
 
     return xRet;
 }
 
 // --------------------------------------------------------------------
 
+rtl::Reference< SlideShow > SlideShow::GetSlideShow( SdDrawDocument& rDocument )
+{
+    return rtl::Reference< SlideShow >(
+        dynamic_cast< SlideShow* >( rDocument.getPresentation().get() ) );
+}
+
+// --------------------------------------------------------------------
+
 rtl::Reference< SlideShow > SlideShow::GetSlideShow( ViewShellBase& rBase )
 {
     return GetSlideShow( rBase.GetDocument() );
diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
index b55e00d..4d63677 100644
--- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx
+++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
@@ -147,7 +147,7 @@ TYPEINIT1(SlideSorterView, ::sd::View);
 
 SlideSorterView::SlideSorterView (SlideSorter& rSlideSorter)
     : ::sd::View (
-          rSlideSorter.GetModel().GetDocument(),
+          *rSlideSorter.GetModel().GetDocument(),
           rSlideSorter.GetContentWindow().get(),
           rSlideSorter.GetViewShell()),
       mrSlideSorter(rSlideSorter),
diff --git a/sd/source/ui/view/ViewClipboard.cxx b/sd/source/ui/view/ViewClipboard.cxx
index 2f65a8a..d535122 100644
--- a/sd/source/ui/view/ViewClipboard.cxx
+++ b/sd/source/ui/view/ViewClipboard.cxx
@@ -150,9 +150,7 @@ void ViewClipboard::AssignMasterPage (
     if (pPage == NULL)
         return;
 
-    SdDrawDocument* pDocument = mrView.GetDoc();
-    if (pDocument == NULL)
-        return;
+    SdDrawDocument& rDocument = mrView.GetDoc();
 
     if ( ! rTransferable.HasPageBookmarks())
         return;
@@ -175,7 +173,7 @@ void ViewClipboard::AssignMasterPage (
         sLayoutSuffix))
         sLayoutName = String(sLayoutName, 0, sLayoutName.Len()-nLength);
 
-    pDocument->SetMasterPage (
+    rDocument.SetMasterPage (
         pPage->GetPageNum() / 2,
         sLayoutName,
         pSourceDocument,
@@ -190,15 +188,15 @@ void ViewClipboard::AssignMasterPage (
 sal_uInt16 ViewClipboard::DetermineInsertPosition  (
     const SdTransferable& )
 {
-    SdDrawDocument* pDoc = mrView.GetDoc();
-    sal_uInt16 nPgCnt = pDoc->GetSdPageCount( PK_STANDARD );
+    SdDrawDocument& rDoc = mrView.GetDoc();
+    sal_uInt16 nPgCnt = rDoc.GetSdPageCount( PK_STANDARD );
 
     // Insert position is the behind the last selected page or behind the
     // last page when the selection is empty.
-    sal_uInt16 nInsertPos = pDoc->GetSdPageCount( PK_STANDARD ) * 2 + 1;
+    sal_uInt16 nInsertPos = rDoc.GetSdPageCount( PK_STANDARD ) * 2 + 1;
     for( sal_uInt16 nPage = 0; nPage < nPgCnt; nPage++ )
     {
-        SdPage* pPage = pDoc->GetSdPage( nPage, PK_STANDARD );
+        SdPage* pPage = rDoc.GetSdPage( nPage, PK_STANDARD );
 
         if( pPage->IsSelected() )
             nInsertPos = nPage * 2 + 3;
@@ -214,10 +212,10 @@ sal_uInt16 ViewClipboard::InsertSlides (
     const SdTransferable& rTransferable,
     sal_uInt16 nInsertPosition)
 {
-    SdDrawDocument* pDoc = mrView.GetDoc();
+    SdDrawDocument& rDoc = mrView.GetDoc();
 
     sal_uInt16 nInsertPgCnt = 0;
-    sal_Bool bMergeMasterPages = !rTransferable.HasSourceDoc( pDoc );
+    sal_Bool bMergeMasterPages = !rTransferable.HasSourceDoc( &rDoc );
 
     // Prepare the insertion.
     const List* pBookmarkList;
@@ -250,7 +248,7 @@ sal_uInt16 ViewClipboard::InsertSlides (
         if( bWait )
             pWin->LeaveWait();
 
-        pDoc->InsertBookmarkAsPage(
+        rDoc.InsertBookmarkAsPage(
             const_cast<List*>(pBookmarkList),
             NULL,
             sal_False,
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index 7d20db8..e76993c 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -95,7 +95,7 @@ TYPEINIT1(DrawView, View);
 \************************************************************************/
 
 DrawView::DrawView( DrawDocShell* pDocSh, OutputDevice* pOutDev, DrawViewShell* pShell)
-: ::sd::View(pDocSh->GetDoc(), pOutDev, pShell)
+: ::sd::View(*pDocSh->GetDoc(), pOutDev, pShell)
 , mpDocShell(pDocSh)
 , mpDrawViewShell(pShell)
 , mpVDev(NULL)
@@ -140,7 +140,7 @@ void DrawView::ModelHasChanged()
     ::sd::View::ModelHasChanged();
 
     // den Gestalter zur Neudarstellung zwingen
-    SfxStyleSheetBasePool* pSSPool = mpDoc->GetStyleSheetPool();
+    SfxStyleSheetBasePool* pSSPool = mrDoc.GetStyleSheetPool();
     pSSPool->Broadcast(SfxStyleSheetPoolHint(SFX_STYLESHEETPOOL_CHANGES));
 
     if( mpDrawViewShell )
@@ -163,7 +163,7 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
     // wird eine Masterpage bearbeitet?
     if ( mpDrawViewShell && mpDrawViewShell->GetEditMode() == EM_MASTERPAGE )
     {
-        SfxStyleSheetBasePool* pStShPool = mpDoc->GetStyleSheetPool();
+        SfxStyleSheetBasePool* pStShPool = mrDoc.GetStyleSheetPool();
         SdPage& rPage = *mpDrawViewShell->getCurrentPage();
         String aLayoutName = rPage.GetName();
         SdrTextObj* pEditObject = static_cast< SdrTextObj* >( GetTextEditObject() );
@@ -192,7 +192,7 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
                     aTempSet.ClearInvalidItems();
 
                     // Undo-Action
-                    StyleSheetUndoAction* pAction = new StyleSheetUndoAction(mpDoc, pSheet, &aTempSet);
+                    StyleSheetUndoAction* pAction = new StyleSheetUndoAction(&mrDoc, pSheet, &aTempSet);
                     mpDocSh->GetUndoManager()->AddUndoAction(pAction);
 
                     pSheet->GetItemSet().Put(aTempSet);
@@ -244,7 +244,7 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
                         }
 
                         // Undo-Action
-                        StyleSheetUndoAction* pAction = new StyleSheetUndoAction(mpDoc, pSheet, &aTempSet);
+                        StyleSheetUndoAction* pAction = new StyleSheetUndoAction(&mrDoc, pSheet, &aTempSet);
                         mpDocSh->GetUndoManager()->AddUndoAction(pAction);
 
                         pSheet->GetItemSet().Put(aTempSet);
@@ -312,7 +312,7 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
                         aTempSet.ClearInvalidItems();
 
                         // Undo-Action
-                        StyleSheetUndoAction* pAction = new StyleSheetUndoAction(mpDoc, pSheet, &aTempSet);
+                        StyleSheetUndoAction* pAction = new StyleSheetUndoAction(&mrDoc, pSheet, &aTempSet);
                         mpDocSh->GetUndoManager()->AddUndoAction(pAction);
 
                         pSheet->GetItemSet().Put(aTempSet,false);
@@ -357,7 +357,7 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
                             aTempSet.ClearInvalidItems();
 
                             // Undo-Action
-                            StyleSheetUndoAction* pAction = new StyleSheetUndoAction(mpDoc, pSheet, &aTempSet);
+                            StyleSheetUndoAction* pAction = new StyleSheetUndoAction(&mrDoc, pSheet, &aTempSet);
                             mpDocSh->GetUndoManager()->AddUndoAction(pAction);
 
                             pSheet->GetItemSet().Set(aTempSet,false);
@@ -578,7 +578,7 @@ void DrawView::DeleteMarked()
 {
     OSL_TRACE( "DrawView::DeleteMarked() - enter" );
 
-    sd::UndoManager* pUndoManager = mpDoc->GetUndoManager();
+    sd::UndoManager* pUndoManager = mrDoc.GetUndoManager();
     DBG_ASSERT( pUndoManager, "sd::DrawView::DeleteMarked(), ui action without undo manager!?" );
 
     if( pUndoManager )
diff --git a/sd/source/ui/view/drbezob.cxx b/sd/source/ui/view/drbezob.cxx
index a247410..e28cb07 100644
--- a/sd/source/ui/view/drbezob.cxx
+++ b/sd/source/ui/view/drbezob.cxx
@@ -122,7 +122,7 @@ BezierObjectBar::~BezierObjectBar()
 
 void BezierObjectBar::GetAttrState(SfxItemSet& rSet)
 {
-    SfxItemSet aAttrSet( mpView->GetDoc()->GetPool() );
+    SfxItemSet aAttrSet( mpView->GetDoc().GetPool() );
     mpView->GetAttributes( aAttrSet );
     rSet.Put(aAttrSet, sal_False); // <- sal_False, damit DontCare-Status uebernommen wird
 
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index 9362c48..9697587 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -125,17 +125,13 @@ TextObjectBar::TextObjectBar (
         }
         else
         {
-            SdDrawDocument* pDoc = mpView->GetDoc();
-            if( pDoc )
+            DrawDocShell* pDocShell = mpView->GetDoc().GetDocSh();
+            if( pDocShell )
             {
-                DrawDocShell* pDocShell = pDoc->GetDocSh();
-                if( pDocShell )
-                {
-                    SetUndoManager(pDocShell->GetUndoManager());
-                    DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >( pSdViewSh );
-                    if ( pDrawViewShell )
-                        SetRepeatTarget(pSdView);
-                }
+                SetUndoManager(pDocShell->GetUndoManager());
+                DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >( pSdViewSh );
+                if ( pDrawViewShell )
+                    SetRepeatTarget(pSdView);
             }
         }
     }
@@ -166,7 +162,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
 {
     SfxWhichIter        aIter( rSet );
     sal_uInt16              nWhich = aIter.FirstWhich();
-    SfxItemSet          aAttrSet( mpView->GetDoc()->GetPool() );
+    SfxItemSet          aAttrSet( mpView->GetDoc().GetPool() );
     SvtLanguageOptions  aLangOpt;
     sal_Bool            bDisableParagraphTextDirection = !aLangOpt.IsCTLFontEnabled();
     sal_Bool            bDisableVerticalText = !aLangOpt.IsVerticalTextEnabled();
@@ -514,8 +510,8 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
                 // The case for the superordinate object is missing.
                 case FRMDIR_ENVIRONMENT:
                 {
-                    SdDrawDocument* pDoc = mpView->GetDoc();
-                    ::com::sun::star::text::WritingMode eMode = pDoc->GetDefaultWritingMode();
+                    SdDrawDocument& rDoc = mpView->GetDoc();
+                    ::com::sun::star::text::WritingMode eMode = rDoc.GetDefaultWritingMode();
                     sal_Bool bIsLeftToRight(sal_False);
 
                     if(::com::sun::star::text::WritingMode_LR_TB == eMode
diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx
index 8aa52fa..feef729 100644
--- a/sd/source/ui/view/drtxtob1.cxx
+++ b/sd/source/ui/view/drtxtob1.cxx
@@ -114,9 +114,9 @@ void TextObjectBar::Execute( SfxRequest &rReq )
         {
             if( pArgs )
             {
-                SdDrawDocument* pDoc = mpView->GetDoc();
+                SdDrawDocument& rDoc = mpView->GetDoc();
                 OSL_ASSERT (mpViewShell->GetViewShell()!=NULL);
-                FunctionReference xFunc( FuTemplate::Create( mpViewShell, static_cast< ::sd::Window*>( mpViewShell->GetViewShell()->GetWindow()), mpView, pDoc, rReq ) );
+                FunctionReference xFunc( FuTemplate::Create( mpViewShell, static_cast< ::sd::Window*>( mpViewShell->GetViewShell()->GetWindow()), mpView, &rDoc, rReq ) );
 
                 if(xFunc.is())
                 {
@@ -200,7 +200,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
                 // JOE einen richtigen Status (DontCare) bekomme;
 
                 // Wird enabled, obwohl es nicht richtig funktioniert (s.o.)
-                SfxItemSet aEditAttr( mpView->GetDoc()->GetPool() );
+                SfxItemSet aEditAttr( mpView->GetDoc().GetPool() );
                 mpView->GetAttributes( aEditAttr );
                 if( aEditAttr.GetItemState( EE_PARA_ULSPACE ) >= SFX_ITEM_AVAILABLE )
                 {
@@ -303,7 +303,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
         case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
         {
             mpView->SdrEndTextEdit();
-            SfxItemSet aAttr( mpView->GetDoc()->GetPool(), SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, 0 );
+            SfxItemSet aAttr( mpView->GetDoc().GetPool(), SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, 0 );
             aAttr.Put( SvxWritingModeItem(
                 nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ?
                     com::sun::star::text::WritingMode_LR_TB : com::sun::star::text::WritingMode_TB_RL,
@@ -347,7 +347,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
 
         default:
         {
-            SfxItemSet aEditAttr( mpView->GetDoc()->GetPool() );
+            SfxItemSet aEditAttr( mpView->GetDoc().GetPool() );
             mpView->GetAttributes( aEditAttr );
             SfxItemSet aNewAttr(*(aEditAttr.GetPool()), aEditAttr.GetRanges());
 
@@ -556,7 +556,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
                 if (nSlot == SID_ATTR_CHAR_FONT)
                     nScriptType = mpView->GetScriptType();
 
-                SfxItemPool& rPool = mpView->GetDoc()->GetPool();
+                SfxItemPool& rPool = mpView->GetDoc().GetPool();
                 SvxScriptSetItem aSvxScriptSetItem( nSlot, rPool );
                 aSvxScriptSetItem.PutItemForScriptType( nScriptType, pArgs->Get( rPool.GetWhich( nSlot ) ) );
                 aNewAttr.Put( aSvxScriptSetItem.GetItemSet() );
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index f7425f7..b72f0fa 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -153,7 +153,7 @@ void OutlineViewShell::Construct(DrawDocShell* )
     GetActiveWindow()->SetMinZoom( MIN_ZOOM );
     GetActiveWindow()->SetMaxZoom( MAX_ZOOM );
     InitWindows(aViewOrigin, aSize, aWinPos);
-    pOlView = new OutlineView(GetDocSh(), GetActiveWindow(), this);
+    pOlView = new OutlineView(*GetDocSh(), GetActiveWindow(), *this);
     mpView = pOlView;            // Pointer of base class ViewShell
 
     SetPool( &GetDoc()->GetPool() );
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index 85239e8..8d4d1cc 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -107,10 +107,10 @@ TYPEINIT1( OutlineView, ::sd::View );
 |*
 \************************************************************************/
 
-OutlineView::OutlineView( DrawDocShell* pDocSh, ::Window* pWindow, OutlineViewShell* pOutlineViewSh)
-: ::sd::View(pDocSh->GetDoc(), pWindow, pOutlineViewSh)
-, mpOutlineViewShell(pOutlineViewSh)
-, mpOutliner( mpDoc->GetOutliner(sal_True) )
+OutlineView::OutlineView( DrawDocShell& rDocSh, ::Window* pWindow, OutlineViewShell& rOutlineViewSh)
+: ::sd::View(*rDocSh.GetDoc(), pWindow, &rOutlineViewSh)
+, mrOutlineViewShell(rOutlineViewSh)
+, mrOutliner(*mrDoc.GetOutliner(sal_True))
 , mnPagesToProcess(0)
 , mnPagesProcessed(0)
 , mbFirstPaint(sal_True)
@@ -121,14 +121,14 @@ OutlineView::OutlineView( DrawDocShell* pDocSh, ::Window* pWindow, OutlineViewSh
 {
     sal_Bool bInitOutliner = sal_False;
 
-    if (mpOutliner->GetViewCount() == 0)
+    if (mrOutliner.GetViewCount() == 0)
     {
         // initialize Outliner: set Reference Device
         bInitOutliner = sal_True;
-        mpOutliner->Init( OUTLINERMODE_OUTLINEVIEW );
-        mpOutliner->SetRefDevice( SD_MOD()->GetRefDevice( *pDocSh ) );
+        mrOutliner.Init( OUTLINERMODE_OUTLINEVIEW );
+        mrOutliner.SetRefDevice( SD_MOD()->GetRefDevice( rDocSh ) );
         sal_uLong nWidth = OUTLINE_PAPERWIDTH;
-        mpOutliner->SetPaperSize(Size(nWidth, 400000000));
+        mrOutliner.SetPaperSize(Size(nWidth, 400000000));
     }
 
     // insert View into Outliner
@@ -137,11 +137,11 @@ OutlineView::OutlineView( DrawDocShell* pDocSh, ::Window* pWindow, OutlineViewSh
         mpOutlinerView[nView] = NULL;
     }
 
-    mpOutlinerView[0] = new OutlinerView(mpOutliner, pWindow);
+    mpOutlinerView[0] = new OutlinerView(&mrOutliner, pWindow);
     Rectangle aNullRect;
     mpOutlinerView[0]->SetOutputArea(aNullRect);
-    mpOutliner->SetUpdateMode(sal_False);
-    mpOutliner->InsertView(mpOutlinerView[0], LIST_APPEND);
+    mrOutliner.SetUpdateMode(sal_False);
+    mrOutliner.InsertView(mpOutlinerView[0], LIST_APPEND);
 
     onUpdateStyleSettings( true );
 
@@ -152,12 +152,12 @@ OutlineView::OutlineView( DrawDocShell* pDocSh, ::Window* pWindow, OutlineViewSh
     }
 
     Link aLink( LINK(this,OutlineView,EventMultiplexerListener) );
-    mpOutlineViewShell->GetViewShellBase().GetEventMultiplexer()->AddEventListener(
+    mrOutlineViewShell.GetViewShellBase().GetEventMultiplexer()->AddEventListener(
         aLink,
         tools::EventMultiplexerEvent::EID_CURRENT_PAGE
         | tools::EventMultiplexerEvent::EID_PAGE_ORDER);
 
-    LanguageType eLang = mpOutliner->GetDefaultLanguage();
+    LanguageType eLang = mrOutliner.GetDefaultLanguage();
     maPageNumberFont = OutputDevice::GetDefaultFont( DEFAULTFONT_SANS_UNICODE, eLang, 0 );
     maPageNumberFont.SetHeight( 500 );
 
@@ -173,7 +173,7 @@ OutlineView::OutlineView( DrawDocShell* pDocSh, ::Window* pWindow, OutlineViewSh
     maBulletFont.SetShadow(sal_False);
 
 
-    Reference<XFrame> xFrame (mpOutlineViewShell->GetViewShellBase().GetFrame()->GetTopFrame().GetFrameInterface(), UNO_QUERY);
+    Reference<XFrame> xFrame (mrOutlineViewShell.GetViewShellBase().GetFrame()->GetTopFrame().GetFrameInterface(), UNO_QUERY);
 
     const OUString aSlotURL( RTL_CONSTASCII_USTRINGPARAM( ".uno:ShowSlide" ));
     maSlideImage = GetImage( xFrame, aSlotURL, true );
@@ -182,7 +182,7 @@ OutlineView::OutlineView( DrawDocShell* pDocSh, ::Window* pWindow, OutlineViewSh
     // outliner, so that the former can synchronize with the later.
     sd::UndoManager* pDocUndoMgr = dynamic_cast<sd::UndoManager*>(mpDocSh->GetUndoManager());
     if (pDocUndoMgr != NULL)
-        pDocUndoMgr->SetLinkedUndoManager(&mpOutliner->GetUndoManager());
+        pDocUndoMgr->SetLinkedUndoManager(&mrOutliner.GetUndoManager());
 }
 
 /*************************************************************************
@@ -196,7 +196,7 @@ OutlineView::~OutlineView()
     DBG_ASSERT(maDragAndDropModelGuard.get() == 0, "sd::OutlineView::~OutlineView(), prior drag operation not finished correctly!" );
 
     Link aLink( LINK(this,OutlineView,EventMultiplexerListener) );
-    mpOutlineViewShell->GetViewShellBase().GetEventMultiplexer()->RemoveEventListener( aLink );
+    mrOutlineViewShell.GetViewShellBase().GetEventMultiplexer()->RemoveEventListener( aLink );
     DisconnectFromApplication();
 
     if( mpProgress )
@@ -207,22 +207,22 @@ OutlineView::~OutlineView()
     {
         if (mpOutlinerView[nView] != NULL)
         {
-            mpOutliner->RemoveView( mpOutlinerView[nView] );
+            mrOutliner.RemoveView( mpOutlinerView[nView] );
             delete mpOutlinerView[nView];
             mpOutlinerView[nView] = NULL;
         }
     }
 
-    if (mpOutliner->GetViewCount() == 0)
+    if (mrOutliner.GetViewCount() == 0)
     {
         // uninitialize Outliner: enable color display
         ResetLinks();
-        sal_uLong nCntrl = mpOutliner->GetControlWord();
-        mpOutliner->SetUpdateMode(sal_False); // otherwise there will be drawn on SetControlWord
-        mpOutliner->SetControlWord(nCntrl & ~EE_CNTRL_NOCOLORS);
+        sal_uLong nCntrl = mrOutliner.GetControlWord();
+        mrOutliner.SetUpdateMode(sal_False); // otherwise there will be drawn on SetControlWord
+        mrOutliner.SetControlWord(nCntrl & ~EE_CNTRL_NOCOLORS);
         SvtAccessibilityOptions aOptions;
-        mpOutliner->ForceAutoColor( aOptions.GetIsAutomaticFontColor() );
-        mpOutliner->Clear();
+        mrOutliner.ForceAutoColor( aOptions.GetIsAutomaticFontColor() );
+        mrOutliner.Clear();
     }
 }
 
@@ -231,7 +231,7 @@ OutlineView::~OutlineView()
 
 void OutlineView::ConnectToApplication (void)
 {
-    mpOutlineViewShell->GetActiveWindow()->GrabFocus();
+    mrOutlineViewShell.GetActiveWindow()->GrabFocus();
     Application::AddEventListener(LINK(this, OutlineView, AppEventListenerHdl));
 }
 
@@ -299,9 +299,9 @@ void OutlineView::AddWindowToPaintView(OutputDevice* pWin)
     {
         if (mpOutlinerView[nView] == NULL)
         {
-            mpOutlinerView[nView] = new OutlinerView(mpOutliner, dynamic_cast< ::sd::Window* >(pWin));
+            mpOutlinerView[nView] = new OutlinerView(&mrOutliner, dynamic_cast< ::sd::Window* >(pWin));
             mpOutlinerView[nView]->SetBackgroundColor( aWhiteColor );
-            mpOutliner->InsertView(mpOutlinerView[nView], LIST_APPEND);
+            mrOutliner.InsertView(mpOutlinerView[nView], LIST_APPEND);
             bAdded = sal_True;
 
             if (bValidArea)
@@ -344,7 +344,7 @@ void OutlineView::DeleteWindowFromPaintView(OutputDevice* pWin)
 
             if (pWindow == pWin)
             {
-                mpOutliner->RemoveView( mpOutlinerView[nView] );
+                mrOutliner.RemoveView( mpOutlinerView[nView] );
                 delete mpOutlinerView[nView];
                 mpOutlinerView[nView] = NULL;
                 bRemoved = sal_True;
@@ -388,14 +388,14 @@ OutlinerView* OutlineView::GetViewByWindow (::Window* pWin) const
 
 Paragraph* OutlineView::GetPrevTitle(const Paragraph* pPara)
 {
-    sal_Int32 nPos = mpOutliner->GetAbsPos(const_cast<Paragraph*>(pPara));
+    sal_Int32 nPos = mrOutliner.GetAbsPos(const_cast<Paragraph*>(pPara));
 
     if (nPos > 0)
     {
         while(nPos)
         {
-            pPara = mpOutliner->GetParagraph(--nPos);
-            if( mpOutliner->HasParaFlag(pPara, PARAFLAG_ISPAGE) )
+            pPara = mrOutliner.GetParagraph(--nPos);
+            if( mrOutliner.HasParaFlag(pPara, PARAFLAG_ISPAGE) )
             {
                 return const_cast< Paragraph* >( pPara );
             }
@@ -415,12 +415,12 @@ Paragraph* OutlineView::GetNextTitle(const Paragraph* pPara)
 {
     Paragraph* pResult = const_cast< Paragraph* >( pPara );
 
-    sal_Int32 nPos = mpOutliner->GetAbsPos(pResult);
+    sal_Int32 nPos = mrOutliner.GetAbsPos(pResult);
 
     do
     {
-        pResult = mpOutliner->GetParagraph(++nPos);
-        if( pResult && mpOutliner->HasParaFlag(pResult, PARAFLAG_ISPAGE) )
+        pResult = mrOutliner.GetParagraph(++nPos);
+        if( pResult && mrOutliner.HasParaFlag(pResult, PARAFLAG_ISPAGE) )
             return pResult;
     }
     while( pResult );
@@ -444,11 +444,11 @@ IMPL_LINK( OutlineView, ParagraphInsertedHdl, ::Outliner *, pOutliner )
 
         Paragraph* pPara = pOutliner->GetHdlParagraph();
 
-        sal_uInt16 nAbsPos = (sal_uInt16)mpOutliner->GetAbsPos( pPara );
+        sal_uInt16 nAbsPos = (sal_uInt16)mrOutliner.GetAbsPos( pPara );
 
         UpdateParagraph( nAbsPos );
 
-        if( (nAbsPos == 0) || mpOutliner->HasParaFlag(pPara,PARAFLAG_ISPAGE) || mpOutliner->HasParaFlag(mpOutliner->GetParagraph( nAbsPos-1 ), PARAFLAG_ISPAGE) )
+        if( (nAbsPos == 0) || mrOutliner.HasParaFlag(pPara,PARAFLAG_ISPAGE) || mrOutliner.HasParaFlag(mrOutliner.GetParagraph( nAbsPos-1 ), PARAFLAG_ISPAGE) )
         {
             InsertSlideForParagraph( pPara );
             InvalidateSlideNumberArea();
@@ -465,7 +465,7 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara )
 
     OutlineViewPageChangesGuard aGuard(this);
 
-    mpOutliner->SetParaFlag( pPara, PARAFLAG_ISPAGE );
+    mrOutliner.SetParaFlag( pPara, PARAFLAG_ISPAGE );
     // how many titles are there before the new title paragraph?
     sal_uLong nExample = 0L;            // position of the "example" page
     sal_uLong nTarget  = 0L;            // position of insertion
@@ -481,7 +481,7 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara )
     // paragraph
     if (nTarget == 1)
     {
-        String aTest(mpOutliner->GetText( mpOutliner->GetParagraph( 0 ) ));
+        String aTest(mrOutliner.GetText( mrOutliner.GetParagraph( 0 ) ));
         if (aTest.Len() == 0)
         {
             nTarget = 0;
@@ -494,7 +494,7 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara )
     {
         nExample = nTarget - 1;
 
-        sal_uInt16 nPageCount = mpDoc->GetSdPageCount( PK_STANDARD );
+        sal_uInt16 nPageCount = mrDoc.GetSdPageCount( PK_STANDARD );
         if( nExample >= nPageCount )
             nExample = nPageCount - 1;
     }
@@ -506,15 +506,15 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara )
     **********************************************************************/
 
     // this page is exemplary
-    SdPage* pExample = (SdPage*)mpDoc->GetSdPage((sal_uInt16)nExample, PK_STANDARD);
-    SdPage* pPage = (SdPage*)mpDoc->AllocPage(sal_False);
+    SdPage* pExample = (SdPage*)mrDoc.GetSdPage((sal_uInt16)nExample, PK_STANDARD);
+    SdPage* pPage = (SdPage*)mrDoc.AllocPage(sal_False);
 
     pPage->SetLayoutName(pExample->GetLayoutName());
 
     // insert (page)
-    mpDoc->InsertPage(pPage, (sal_uInt16)(nTarget) * 2 + 1);
+    mrDoc.InsertPage(pPage, (sal_uInt16)(nTarget) * 2 + 1);
     if( isRecordingUndo() )
-        AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoNewPage(*pPage));
+        AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoNewPage(*pPage));
 
     // assign a master page to the standard page
     pPage->TRG_SetMasterPage(pExample->TRG_GetMasterPage());
@@ -543,17 +543,17 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara )
     /**********************************************************************
     |* now the notes page
     \*********************************************************************/
-    pExample = (SdPage*)mpDoc->GetSdPage((sal_uInt16)nExample, PK_NOTES);
-    SdPage* pNotesPage = (SdPage*)mpDoc->AllocPage(sal_False);
+    pExample = (SdPage*)mrDoc.GetSdPage((sal_uInt16)nExample, PK_NOTES);
+    SdPage* pNotesPage = (SdPage*)mrDoc.AllocPage(sal_False);
 
     pNotesPage->SetLayoutName(pExample->GetLayoutName());
 
     pNotesPage->SetPageKind(PK_NOTES);
 
     // insert (notes page)
-    mpDoc->InsertPage(pNotesPage, (sal_uInt16)(nTarget) * 2 + 2);
+    mrDoc.InsertPage(pNotesPage, (sal_uInt16)(nTarget) * 2 + 2);
     if( isRecordingUndo() )
-        AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoNewPage(*pNotesPage));
+        AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoNewPage(*pNotesPage));
 
     // assign a master page to the notes page
     pNotesPage->TRG_SetMasterPage(pExample->TRG_GetMasterPage());
@@ -568,7 +568,7 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara )
     // create presentation objects
     pNotesPage->SetAutoLayout(pExample->GetAutoLayout(), sal_True);
 
-    mpOutliner->UpdateFields();
+    mrOutliner.UpdateFields();
 
     return pPage;
 }
@@ -598,16 +598,16 @@ IMPL_LINK( OutlineView, ParagraphRemovingHdl, ::Outliner *, pOutliner )
 
         // delete page and notes page
         sal_uInt16 nAbsPos = (sal_uInt16)nPos * 2 + 1;
-        SdrPage* pPage = mpDoc->GetPage(nAbsPos);
+        SdrPage* pPage = mrDoc.GetPage(nAbsPos);
         if( isRecordingUndo() )
-            AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeletePage(*pPage));
-        mpDoc->RemovePage(nAbsPos);
+            AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoDeletePage(*pPage));
+        mrDoc.RemovePage(nAbsPos);
 
         nAbsPos = (sal_uInt16)nPos * 2 + 1;
-        pPage = mpDoc->GetPage(nAbsPos);
+        pPage = mrDoc.GetPage(nAbsPos);
         if( isRecordingUndo() )
-            AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeletePage(*pPage));
-        mpDoc->RemovePage(nAbsPos);
+            AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoDeletePage(*pPage));
+        mrDoc.RemovePage(nAbsPos);
 
         // progress display if necessary
         if (mnPagesToProcess)
@@ -654,13 +654,13 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner )
     {
         // the current paragraph is transformed into a slide
 
-        mpOutliner->SetDepth( pPara, -1 );
+        mrOutliner.SetDepth( pPara, -1 );
 
         // are multiple level 1 paragraphs being brought to level 0 and we
         // should start a progress view or a timer and didn't already?
         if (mnPagesToProcess == 0)
         {
-            Window*       pActWin = mpOutlineViewShell->GetActiveWindow();
+            Window*       pActWin = mrOutlineViewShell.GetActiveWindow();
             OutlinerView* pOlView = GetViewByWindow(pActWin);
 
             std::vector<Paragraph*> aSelList;
@@ -737,20 +737,20 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner )
         // delete page and notes page
 
         sal_uInt16 nAbsPos = (sal_uInt16)nPos * 2 + 1;
-        SdrPage* pPage = mpDoc->GetPage(nAbsPos);
+        SdrPage* pPage = mrDoc.GetPage(nAbsPos);
         if( isRecordingUndo() )
-            AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeletePage(*pPage));
-        mpDoc->RemovePage(nAbsPos);
+            AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoDeletePage(*pPage));
+        mrDoc.RemovePage(nAbsPos);
 
         nAbsPos = (sal_uInt16)nPos * 2 + 1;
-        pPage = mpDoc->GetPage(nAbsPos);
+        pPage = mrDoc.GetPage(nAbsPos);
         if( isRecordingUndo() )
-            AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeletePage(*pPage));
-        mpDoc->RemovePage(nAbsPos);
+            AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoDeletePage(*pPage));
+        mrDoc.RemovePage(nAbsPos);
 
         pPage = GetPageForParagraph( pPara );
 
-        mpOutliner->SetDepth( pPara, (pPage && (static_cast<SdPage*>(pPage)->GetAutoLayout() == AUTOLAYOUT_TITLE)) ?  -1 : 0 );
+        mrOutliner.SetDepth( pPara, (pPage && (static_cast<SdPage*>(pPage)->GetAutoLayout() == AUTOLAYOUT_TITLE)) ?  -1 : 0 );
 
         // progress display if necessary
         if (mnPagesToProcess)
@@ -787,7 +787,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner )
 
         if(nPos >= 0)
         {
-            SdPage*pPage = (SdPage*)mpDoc->GetSdPage( (sal_uInt16) nPos, PK_STANDARD);
+            SdPage*pPage = (SdPage*)mrDoc.GetSdPage( (sal_uInt16) nPos, PK_STANDARD);
 
             if(pPage && pPage->GetPresObj(PRESOBJ_TEXT))
                 pOutliner->SetDepth( pPara, 0 );
@@ -807,7 +807,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner )
 
     if( nPos >= 0 )
     {
-        SdPage* pPage = (SdPage*) mpDoc->GetSdPage( (sal_uInt16) nPos, PK_STANDARD );
+        SdPage* pPage = (SdPage*) mrDoc.GetSdPage( (sal_uInt16) nPos, PK_STANDARD );
 
         if( pPage )
         {
@@ -833,7 +833,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner )
                     String aNewStyleSheetName( pStyleSheet->GetName() );
                     aNewStyleSheetName.Erase( aNewStyleSheetName.Len()-1, 1 );
                     aNewStyleSheetName += String::CreateFromInt32( nDepth+1 );
-                    SfxStyleSheetBasePool* pStylePool = mpDoc->GetStyleSheetPool();
+                    SfxStyleSheetBasePool* pStylePool = mrDoc.GetStyleSheetPool();
                     pStyleSheet = (SfxStyleSheet*) pStylePool->Find( aNewStyleSheetName, pStyleSheet->GetFamily() );
                 }
             }
@@ -868,13 +868,13 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner )
 
 IMPL_LINK( OutlineView, StatusEventHdl, EditStatus *, EMPTYARG )
 {
-    ::sd::Window*   pWin = mpOutlineViewShell->GetActiveWindow();
+    ::sd::Window*   pWin = mrOutlineViewShell.GetActiveWindow();
     OutlinerView*   pOutlinerView = GetViewByWindow(pWin);
     Rectangle     aVis          = pOutlinerView->GetVisArea();
     sal_uLong nWidth = OUTLINE_PAPERWIDTH;
     Rectangle aText = Rectangle(Point(0,0),
                                    Size(nWidth,
-                                        mpOutliner->GetTextHeight()));
+                                        mrOutliner.GetTextHeight()));
     Rectangle aWin(Point(0,0), pWin->GetOutputSizePixel());
     aWin = pWin->PixelToLogic(aWin);
 
@@ -882,9 +882,9 @@ IMPL_LINK( OutlineView, StatusEventHdl, EditStatus *, EMPTYARG )
     {
         aText.Bottom() += aWin.GetHeight();
 
-        mpOutlineViewShell->InitWindows(Point(0,0), aText.GetSize(),
+        mrOutlineViewShell.InitWindows(Point(0,0), aText.GetSize(),
                                        Point(aVis.TopLeft()));
-        mpOutlineViewShell->UpdateScrollBars();
+        mrOutlineViewShell.UpdateScrollBars();
     }
 
     InvalidateSlideNumberArea();
@@ -938,7 +938,7 @@ IMPL_LINK( OutlineView, BeginMovingHdl, ::Outliner *, pOutliner )
         if( pOutliner->HasParaFlag(pPara, PARAFLAG_ISPAGE) )                     // one page?
         {
             maOldParaOrder.push_back(pPara);
-            SdPage* pPage = mpDoc->GetSdPage(nPos, PK_STANDARD);
+            SdPage* pPage = mrDoc.GetSdPage(nPos, PK_STANDARD);
 
             fiter = std::find(maSelectedParas.begin(),maSelectedParas.end(),pPara);
 
@@ -1002,13 +1002,13 @@ IMPL_LINK( OutlineView, EndMovingHdl, ::Outliner *, pOutliner )
         DBG_ASSERT(nPos != 0xffff, "Absatz nicht gefunden");
     }
 
-    mpDoc->MovePages(nPos);
+    mrDoc.MovePages(nPos);
 
     // deselect the pages again
     sal_uInt16 nPageCount = (sal_uInt16)maSelectedParas.size();
     while (nPageCount)
     {
-        SdPage* pPage = mpDoc->GetSdPage(nPosNewOrder, PK_STANDARD);
+        SdPage* pPage = mrDoc.GetSdPage(nPosNewOrder, PK_STANDARD);
         pPage->SetSelected(sal_False);
         nPosNewOrder++;
         nPageCount--;
@@ -1137,13 +1137,13 @@ sal_Bool OutlineView::PrepareClose(sal_Bool)
     if (pDocUndoMgr != NULL)
         pDocUndoMgr->SetLinkedUndoManager(NULL);
 
-    mpOutliner->GetUndoManager().Clear();
+    mrOutliner.GetUndoManager().Clear();
 
     const String aUndoStr(SdResId(STR_UNDO_CHANGE_TITLE_AND_LAYOUT));
     BegUndo(aUndoStr);
     UpdateDocument();
     EndUndo();
-    mpDoc->SetSelected(GetActualPage(), sal_True);
+    mrDoc.SetSelected(GetActualPage(), sal_True);
     return sal_True;
 }
 
@@ -1158,7 +1158,7 @@ sal_Bool OutlineView::SetAttributes(const SfxItemSet& rSet, sal_Bool )
 {
     sal_Bool bOk = sal_False;
 
-    OutlinerView* pOlView = GetViewByWindow(mpOutlineViewShell->GetActiveWindow());
+    OutlinerView* pOlView = GetViewByWindow(mrOutlineViewShell.GetActiveWindow());
 
     if (pOlView)
     {
@@ -1166,7 +1166,7 @@ sal_Bool OutlineView::SetAttributes(const SfxItemSet& rSet, sal_Bool )
         bOk = sal_True;
     }
 
-    mpOutlineViewShell->Invalidate (SID_PREVIEW_STATE);
+    mrOutlineViewShell.Invalidate (SID_PREVIEW_STATE);
 
     return (bOk);
 }
@@ -1180,7 +1180,7 @@ sal_Bool OutlineView::SetAttributes(const SfxItemSet& rSet, sal_Bool )
 sal_Bool OutlineView::GetAttributes( SfxItemSet& rTargetSet, sal_Bool ) const
 {
     OutlinerView* pOlView = GetViewByWindow(
-                                mpOutlineViewShell->GetActiveWindow());
+                                mrOutlineViewShell.GetActiveWindow());
     DBG_ASSERT(pOlView, "keine OutlinerView gefunden");
 
     rTargetSet.Put( pOlView->GetAttribs(), sal_False );
@@ -1190,18 +1190,18 @@ sal_Bool OutlineView::GetAttributes( SfxItemSet& rTargetSet, sal_Bool ) const
 /** creates outliner model from draw model */
 void OutlineView::FillOutliner()
 {
-    mpOutliner->GetUndoManager().Clear();
-    mpOutliner->EnableUndo(sal_False);
+    mrOutliner.GetUndoManager().Clear();
+    mrOutliner.EnableUndo(sal_False);
     ResetLinks();
-    mpOutliner->SetUpdateMode(false);
+    mrOutliner.SetUpdateMode(false);
 
     Paragraph* pTitleToSelect = NULL;
-    sal_uLong nPageCount = mpDoc->GetSdPageCount(PK_STANDARD);
+    sal_uLong nPageCount = mrDoc.GetSdPageCount(PK_STANDARD);
 
     // fill outliner with paragraphs from slides title & (outlines|subtitles)
     for (sal_uInt16 nPage = 0; nPage < nPageCount; nPage++)
     {
-        SdPage*     pPage = (SdPage*)mpDoc->GetSdPage(nPage, PK_STANDARD);
+        SdPage*     pPage = (SdPage*)mrDoc.GetSdPage(nPage, PK_STANDARD);
         Paragraph * pPara = NULL;
 
         // take text from title shape
@@ -1213,27 +1213,27 @@ void OutlineView::FillOutliner()
             {
                 sal_Bool bVertical = pOPO->IsVertical();
                 pOPO->SetVertical( sal_False );
-                mpOutliner->AddText(*pOPO);
+                mrOutliner.AddText(*pOPO);
                 pOPO->SetVertical( bVertical );
-                pPara = mpOutliner->GetParagraph( mpOutliner->GetParagraphCount()-1 );
+                pPara = mrOutliner.GetParagraph( mrOutliner.GetParagraphCount()-1 );
             }
         }
 
         if( pPara == 0 ) // no title, insert an empty paragraph
         {
-            pPara = mpOutliner->Insert(String());
-            mpOutliner->SetDepth(pPara, -1);
+            pPara = mrOutliner.Insert(String());
+            mrOutliner.SetDepth(pPara, -1);
 
             // do not apply hard attributes from the previous paragraph
-            mpOutliner->SetParaAttribs( (sal_uInt16)mpOutliner->GetAbsPos(pPara),
-                                       mpOutliner->GetEmptyItemSet() );
+            mrOutliner.SetParaAttribs( (sal_uInt16)mrOutliner.GetAbsPos(pPara),
+                                       mrOutliner.GetEmptyItemSet() );
 
-            mpOutliner->SetStyleSheet( mpOutliner->GetAbsPos( pPara ), pPage->GetStyleSheetForPresObj( PRESOBJ_TITLE ) );
+            mrOutliner.SetStyleSheet( mrOutliner.GetAbsPos( pPara ), pPage->GetStyleSheetForPresObj( PRESOBJ_TITLE ) );
         }
 
-        mpOutliner->SetParaFlag( pPara, PARAFLAG_ISPAGE );
+        mrOutliner.SetParaFlag( pPara, PARAFLAG_ISPAGE );
 
-        sal_uLong nPara = mpOutliner->GetAbsPos( pPara );
+        sal_uLong nPara = mrOutliner.GetAbsPos( pPara );
 
         UpdateParagraph( (sal_uInt16)nPara );
 
@@ -1253,20 +1253,20 @@ void OutlineView::FillOutliner()
             OutlinerParaObject* pOPO = pTO->GetOutlinerParaObject();
             if (pOPO)
             {
-                sal_uInt16 nParaCount1 = (sal_uInt16)mpOutliner->GetParagraphCount();
+                sal_uInt16 nParaCount1 = (sal_uInt16)mrOutliner.GetParagraphCount();
                 sal_Bool bVertical = pOPO->IsVertical();
                 pOPO->SetVertical( sal_False );
-                mpOutliner->AddText(*pOPO);
+                mrOutliner.AddText(*pOPO);
                 pOPO->SetVertical( bVertical );
 
-                sal_uInt16 nParaCount2 = (sal_uInt16)mpOutliner->GetParagraphCount();
+                sal_uInt16 nParaCount2 = (sal_uInt16)mrOutliner.GetParagraphCount();
                 for (sal_uInt16 n = nParaCount1; n < nParaCount2; n++)
                 {
                     if( bSubTitle )
                     {
-                        Paragraph* p = mpOutliner->GetParagraph(n);
-                        if(p && mpOutliner->GetDepth( n ) > 0 )
-                            mpOutliner->SetDepth(p, 0);
+                        Paragraph* p = mrOutliner.GetParagraph(n);
+                        if(p && mrOutliner.GetDepth( n ) > 0 )
+                            mrOutliner.SetDepth(p, 0);
                     }
 
                     UpdateParagraph( n );
@@ -1276,7 +1276,7 @@ void OutlineView::FillOutliner()
     }
 
     // place cursor at the start
-    Paragraph* pFirstPara = mpOutliner->GetParagraph( 0 );
+    Paragraph* pFirstPara = mrOutliner.GetParagraph( 0 );
     mpOutlinerView[0]->Select( pFirstPara, sal_True, sal_False );
     mpOutlinerView[0]->Select( pFirstPara, sal_False, sal_False );
 
@@ -1286,9 +1286,9 @@ void OutlineView::FillOutliner()
 
     SetLinks();
 
-    mpOutliner->EnableUndo(sal_True);
+    mrOutliner.EnableUndo(sal_True);
 
-    mpOutliner->SetUpdateMode(true);
+    mrOutliner.SetUpdateMode(true);
 }
 
 /*************************************************************************
@@ -1299,7 +1299,7 @@ void OutlineView::FillOutliner()
 
 IMPL_LINK( OutlineView, RemovingPagesHdl, OutlinerView *, EMPTYARG )
 {
-    sal_uInt16 nNumOfPages = mpOutliner->GetSelPageCount();
+    sal_uInt16 nNumOfPages = mrOutliner.GetSelPageCount();
 
     if (nNumOfPages > PROCESS_WITH_PROGRESS_THRESHOLD)
     {
@@ -1315,7 +1315,7 @@ IMPL_LINK( OutlineView, RemovingPagesHdl, OutlinerView *, EMPTYARG )
         String aStr(SdResId(STR_DELETE_PAGES));
         mpProgress = new SfxProgress( GetDocSh(), aStr, mnPagesToProcess );
     }
-    mpOutliner->UpdateFields();
+    mrOutliner.UpdateFields();
 
     InvalidateSlideNumberArea();
 
@@ -1339,7 +1339,7 @@ IMPL_LINK_INLINE_END( OutlineView, IndentingPagesHdl, OutlinerView *, pOutlinerV
     the cursor is located */
 SdPage* OutlineView::GetActualPage()
 {
-    ::sd::Window* pWin = mpOutlineViewShell->GetActiveWindow();
+    ::sd::Window* pWin = mrOutlineViewShell.GetActiveWindow();
     OutlinerView* pActiveView = GetViewByWindow(pWin);
 
     std::vector<Paragraph*> aSelList;
@@ -1356,12 +1356,12 @@ SdPage* OutlineView::GetActualPage()
     if( pCurrent )
         return pCurrent;
 
-    return mpDoc->GetSdPage( 0, PK_STANDARD );
+    return mrDoc.GetSdPage( 0, PK_STANDARD );
 }
 
 SdPage* OutlineView::GetPageForParagraph( Paragraph* pPara )
 {
-    if( !mpOutliner->HasParaFlag(pPara,PARAFLAG_ISPAGE) )
+    if( !mrOutliner.HasParaFlag(pPara,PARAFLAG_ISPAGE) )
         pPara = GetPrevTitle(pPara);
 
     sal_uInt32 nPageToSelect = 0;
@@ -1372,24 +1372,24 @@ SdPage* OutlineView::GetPageForParagraph( Paragraph* pPara )
             nPageToSelect++;
     }
 
-    if( nPageToSelect < (sal_uInt32)mpDoc->GetSdPageCount( PK_STANDARD ) )
-        return static_cast< SdPage* >( mpDoc->GetSdPage( (sal_uInt16)nPageToSelect, PK_STANDARD) );
+    if( nPageToSelect < (sal_uInt32)mrDoc.GetSdPageCount( PK_STANDARD ) )
+        return static_cast< SdPage* >( mrDoc.GetSdPage( (sal_uInt16)nPageToSelect, PK_STANDARD) );
 
     return 0;
 }
 
-Paragraph* OutlineView::GetParagraphForPage( ::Outliner* pOutl, SdPage* pPage )
+Paragraph* OutlineView::GetParagraphForPage( ::Outliner& rOutl, SdPage* pPage )
 {
     // get the number of paragraphs with ident 0 we need to skip before
     // we finde the actual page
     sal_uInt32 nPagesToSkip = (pPage->GetPageNum() - 1) >> 1;
 
     sal_uInt32 nParaPos = 0;
-    Paragraph* pPara = pOutl->GetParagraph( 0 );
+    Paragraph* pPara = rOutl.GetParagraph( 0 );
     while( pPara )
     {
         // if this paragraph is a page ...
-        if( mpOutliner->HasParaFlag(pPara,PARAFLAG_ISPAGE) )
+        if( mrOutliner.HasParaFlag(pPara,PARAFLAG_ISPAGE) )
         {
             // see if we already skiped enough pages
             if( 0 == nPagesToSkip )
@@ -1400,7 +1400,7 @@ Paragraph* OutlineView::GetParagraphForPage( ::Outliner* pOutl, SdPage* pPage )
         }
 
         // get next paragraph
-        pPara = mpOutliner->GetParagraph( ++nParaPos );
+        pPara = mrOutliner.GetParagraph( ++nParaPos );
     }
 
     return pPara;
@@ -1409,10 +1409,10 @@ Paragraph* OutlineView::GetParagraphForPage( ::Outliner* pOutl, SdPage* pPage )
 /** selects the paragraph for the given page at the outliner view*/
 void OutlineView::SetActualPage( SdPage* pActual )
 {
-    if( pActual && mpOutliner && dynamic_cast<Outliner*> ( mpOutliner )->GetIgnoreCurrentPageChangesLevel()==0 && !mbFirstPaint)
+    if( pActual && dynamic_cast<Outliner&>(mrOutliner).GetIgnoreCurrentPageChangesLevel()==0 && !mbFirstPaint)
     {
         // if we found a paragraph, select its text at the outliner view
-        Paragraph* pPara = GetParagraphForPage( mpOutliner, pActual );
+        Paragraph* pPara = GetParagraphForPage( mrOutliner, pActual );
         if( pPara )
             mpOutlinerView[0]->Select( pPara, sal_True, sal_False );
     }
@@ -1426,7 +1426,7 @@ void OutlineView::SetActualPage( SdPage* pActual )
 
 SfxStyleSheet* OutlineView::GetStyleSheet() const
 {
-     ::sd::Window* pActWin = mpOutlineViewShell->GetActiveWindow();
+     ::sd::Window* pActWin = mrOutlineViewShell.GetActiveWindow();
     OutlinerView* pOlView = GetViewByWindow(pActWin);
     SfxStyleSheet* pResult = pOlView->GetStyleSheet();
     return pResult;
@@ -1448,7 +1448,7 @@ void OutlineView::SetSelectedPages()
 
     for (std::vector<Paragraph*>::iterator it = aSelParas.begin(); it != aSelParas.end();)
     {
-        if (!mpOutliner->HasParaFlag(*it, PARAFLAG_ISPAGE))
+        if (!mrOutliner.HasParaFlag(*it, PARAFLAG_ISPAGE))
             it = aSelParas.erase(it);
         else
             ++it;
@@ -1457,14 +1457,14 @@ void OutlineView::SetSelectedPages()
     // select the pages belonging to the paragraphs on level 0 to select
     sal_uInt16 nPos = 0;
     sal_uLong nParaPos = 0;
-    Paragraph *pPara = mpOutliner->GetParagraph( 0 );
+    Paragraph *pPara = mrOutliner.GetParagraph( 0 );
     std::vector<Paragraph*>::const_iterator fiter;
 
     while(pPara)
     {
-        if( mpOutliner->HasParaFlag(pPara, PARAFLAG_ISPAGE) )                     // one page
+        if( mrOutliner.HasParaFlag(pPara, PARAFLAG_ISPAGE) )                     // one page
         {
-            SdPage* pPage = mpDoc->GetSdPage(nPos, PK_STANDARD);
+            SdPage* pPage = mrDoc.GetSdPage(nPos, PK_STANDARD);
             DBG_ASSERT(pPage!=NULL,
                 "Trying to select non-existing page OutlineView::SetSelectedPages()");
 
@@ -1477,7 +1477,7 @@ void OutlineView::SetSelectedPages()
             nPos++;
         }
 
-        pPara = mpOutliner->GetParagraph( ++nParaPos );
+        pPara = mrOutliner.GetParagraph( ++nParaPos );
     }
 }
 
@@ -1491,19 +1491,19 @@ void OutlineView::SetSelectedPages()
 void OutlineView::SetLinks()
 {
     // set notification links
-    mpOutliner->SetParaInsertedHdl(LINK(this, OutlineView, ParagraphInsertedHdl));
-    mpOutliner->SetParaRemovingHdl(LINK(this, OutlineView, ParagraphRemovingHdl));
-    mpOutliner->SetDepthChangedHdl(LINK(this, OutlineView, DepthChangedHdl));
-    mpOutliner->SetBeginMovingHdl(LINK(this, OutlineView, BeginMovingHdl));
-    mpOutliner->SetEndMovingHdl(LINK(this, OutlineView, EndMovingHdl));
-    mpOutliner->SetRemovingPagesHdl(LINK(this, OutlineView, RemovingPagesHdl));
-    mpOutliner->SetIndentingPagesHdl(LINK(this, OutlineView, IndentingPagesHdl));
-    mpOutliner->SetStatusEventHdl(LINK(this, OutlineView, StatusEventHdl));
-    mpOutliner->SetBeginDropHdl(LINK(this,OutlineView, BeginDropHdl));
-    mpOutliner->SetEndDropHdl(LINK(this,OutlineView, EndDropHdl));
-    mpOutliner->SetPaintFirstLineHdl(LINK(this,OutlineView,PaintingFirstLineHdl));
-    mpOutliner->SetBeginPasteOrDropHdl(LINK(this,OutlineView, BeginPasteOrDropHdl));
-    mpOutliner->SetEndPasteOrDropHdl(LINK(this,OutlineView, EndPasteOrDropHdl));
+    mrOutliner.SetParaInsertedHdl(LINK(this, OutlineView, ParagraphInsertedHdl));
+    mrOutliner.SetParaRemovingHdl(LINK(this, OutlineView, ParagraphRemovingHdl));
+    mrOutliner.SetDepthChangedHdl(LINK(this, OutlineView, DepthChangedHdl));
+    mrOutliner.SetBeginMovingHdl(LINK(this, OutlineView, BeginMovingHdl));
+    mrOutliner.SetEndMovingHdl(LINK(this, OutlineView, EndMovingHdl));
+    mrOutliner.SetRemovingPagesHdl(LINK(this, OutlineView, RemovingPagesHdl));
+    mrOutliner.SetIndentingPagesHdl(LINK(this, OutlineView, IndentingPagesHdl));
+    mrOutliner.SetStatusEventHdl(LINK(this, OutlineView, StatusEventHdl));
+    mrOutliner.SetBeginDropHdl(LINK(this,OutlineView, BeginDropHdl));
+    mrOutliner.SetEndDropHdl(LINK(this,OutlineView, EndDropHdl));
+    mrOutliner.SetPaintFirstLineHdl(LINK(this,OutlineView,PaintingFirstLineHdl));
+    mrOutliner.SetBeginPasteOrDropHdl(LINK(this,OutlineView, BeginPasteOrDropHdl));
+    mrOutliner.SetEndPasteOrDropHdl(LINK(this,OutlineView, EndPasteOrDropHdl));
 }
 
 
@@ -1517,17 +1517,17 @@ void OutlineView::SetLinks()
 void OutlineView::ResetLinks() const
 {
     Link aEmptyLink;
-    mpOutliner->SetParaInsertedHdl(aEmptyLink);
-    mpOutliner->SetParaRemovingHdl(aEmptyLink);
-    mpOutliner->SetDepthChangedHdl(aEmptyLink);
-    mpOutliner->SetBeginMovingHdl(aEmptyLink);
-    mpOutliner->SetEndMovingHdl(aEmptyLink);
-    mpOutliner->SetStatusEventHdl(aEmptyLink);
-    mpOutliner->SetRemovingPagesHdl(aEmptyLink);
-    mpOutliner->SetIndentingPagesHdl(aEmptyLink);
-    mpOutliner->SetDrawPortionHdl(aEmptyLink);
-    mpOutliner->SetBeginPasteOrDropHdl(aEmptyLink);
-    mpOutliner->SetEndPasteOrDropHdl(aEmptyLink);
+    mrOutliner.SetParaInsertedHdl(aEmptyLink);
+    mrOutliner.SetParaRemovingHdl(aEmptyLink);
+    mrOutliner.SetDepthChangedHdl(aEmptyLink);
+    mrOutliner.SetBeginMovingHdl(aEmptyLink);
+    mrOutliner.SetEndMovingHdl(aEmptyLink);
+    mrOutliner.SetStatusEventHdl(aEmptyLink);
+    mrOutliner.SetRemovingPagesHdl(aEmptyLink);
+    mrOutliner.SetIndentingPagesHdl(aEmptyLink);
+    mrOutliner.SetDrawPortionHdl(aEmptyLink);
+    mrOutliner.SetBeginPasteOrDropHdl(aEmptyLink);
+    mrOutliner.SetEndPasteOrDropHdl(aEmptyLink);
 }
 
 /*************************************************************************
@@ -1557,15 +1557,11 @@ sal_uInt16 OutlineView::GetScriptType() const
 {
     sal_uInt16 nScriptType = ::sd::View::GetScriptType();
 
-    if(mpOutliner)
+    OutlinerParaObject* pTempOPObj = mrOutliner.CreateParaObject();
+    if(pTempOPObj)
     {
-        OutlinerParaObject* pTempOPObj = mpOutliner->CreateParaObject();
-
-        if(pTempOPObj)
-        {
-            nScriptType = pTempOPObj->GetTextObject().GetScriptType();
-            delete pTempOPObj;
-        }
+        nScriptType = pTempOPObj->GetTextObject().GetScriptType();
+        delete pTempOPObj;
     }
 
     return nScriptType;
@@ -1592,8 +1588,7 @@ void OutlineView::onUpdateStyleSettings( bool bForceUpdate /* = false */ )
             }
         }
 
-        if( mpOutliner )
-            mpOutliner->SetBackgroundColor( aDocColor );
+        mrOutliner.SetBackgroundColor( aDocColor );
 
         maDocColor = aDocColor;
     }
@@ -1615,18 +1610,18 @@ IMPL_LINK(OutlineView, EventMultiplexerListener, ::sd::tools::EventMultiplexerEv
         switch (pEvent->meEventId)
         {
             case tools::EventMultiplexerEvent::EID_CURRENT_PAGE:
-                SetActualPage(mpOutlineViewShell->GetActualPage());
+                SetActualPage(mrOutlineViewShell.GetActualPage());
                 InvalidateSlideNumberArea();
                 break;
 
             case tools::EventMultiplexerEvent::EID_PAGE_ORDER:
-                if (mpOutliner != NULL && mpDoc!=NULL && dynamic_cast<Outliner*> ( mpOutliner )->GetIgnoreCurrentPageChangesLevel()==0)
+                if (dynamic_cast<Outliner&>(mrOutliner).GetIgnoreCurrentPageChangesLevel()==0)
                 {
-                    if (((mpDoc->GetPageCount()-1)%2) == 0)
+                    if (((mrDoc.GetPageCount()-1)%2) == 0)
                     {
-                        mpOutliner->Clear();
+                        mrOutliner.Clear();
                         FillOutliner();
-                        ::sd::Window* pWindow = mpOutlineViewShell->GetActiveWindow();
+                        ::sd::Window* pWindow = mrOutlineViewShell.GetActiveWindow();
                         if (pWindow != NULL)
                             pWindow->Invalidate();
                     }
@@ -1639,13 +1634,10 @@ IMPL_LINK(OutlineView, EventMultiplexerListener, ::sd::tools::EventMultiplexerEv
 
 void OutlineView::IgnoreCurrentPageChanges (bool bIgnoreChanges)
 {
-    if ( mpOutliner )
-    {
-        if (bIgnoreChanges)
-            dynamic_cast<Outliner*> ( mpOutliner )->IncreIgnoreCurrentPageChangesLevel();
-        else
-            dynamic_cast<Outliner*> ( mpOutliner )->DecreIgnoreCurrentPageChangesLevel();
-    }
+    if (bIgnoreChanges)
+        dynamic_cast<Outliner&>(mrOutliner).IncreIgnoreCurrentPageChangesLevel();
+    else
+        dynamic_cast<Outliner&>(mrOutliner).DecreIgnoreCurrentPageChangesLevel();
 }
 
 /** call this method before you do anything that can modify the outliner
@@ -1653,7 +1645,7 @@ void OutlineView::IgnoreCurrentPageChanges (bool bIgnoreChanges)
 void OutlineView::BeginModelChange()
 {
     const String aEmpty;
-    mpOutliner->GetUndoManager().EnterListAction(aEmpty,aEmpty);
+    mrOutliner.GetUndoManager().EnterListAction(aEmpty,aEmpty);
     const String aUndoStr(SdResId(STR_UNDO_CHANGE_TITLE_AND_LAYOUT));
     BegUndo(aUndoStr);
 }
@@ -1670,36 +1662,36 @@ void OutlineView::EndModelChange()
 
     EndUndo();
 
-    DBG_ASSERT( bHasUndoActions == (mpOutliner->GetUndoManager().GetUndoActionCount() != 0), "sd::OutlineView::EndModelChange(), undo actions not in sync!" );
+    DBG_ASSERT( bHasUndoActions == (mrOutliner.GetUndoManager().GetUndoActionCount() != 0), "sd::OutlineView::EndModelChange(), undo actions not in sync!" );
 
     if( bHasUndoActions )
     {
         SfxLinkUndoAction* pLink = new SfxLinkUndoAction(pDocUndoMgr);
-        mpOutliner->GetUndoManager().AddUndoAction(pLink);
+        mrOutliner.GetUndoManager().AddUndoAction(pLink);
     }
 
-    mpOutliner->GetUndoManager().LeaveListAction();
+    mrOutliner.GetUndoManager().LeaveListAction();
 
-    if( bHasUndoActions && mpOutliner->GetEditEngine().HasTriedMergeOnLastAddUndo() )
+    if( bHasUndoActions && mrOutliner.GetEditEngine().HasTriedMergeOnLastAddUndo() )
         TryToMergeUndoActions();
 
-    mpOutlineViewShell->Invalidate( SID_UNDO );
-    mpOutlineViewShell->Invalidate( SID_REDO );
+    mrOutlineViewShell.Invalidate( SID_UNDO );
+    mrOutlineViewShell.Invalidate( SID_REDO );
 }
 
 /** updates all changes in the outliner model to the draw model */
 void OutlineView::UpdateDocument()
 {
-    const sal_uInt32 nPageCount = mpDoc->GetSdPageCount(PK_STANDARD);
-    Paragraph* pPara = mpOutliner->GetParagraph( 0 );
+    const sal_uInt32 nPageCount = mrDoc.GetSdPageCount(PK_STANDARD);
+    Paragraph* pPara = mrOutliner.GetParagraph( 0 );
     sal_uInt32 nPage;
     for (nPage = 0; nPage < nPageCount; nPage++)
     {
-        SdPage* pPage = mpDoc->GetSdPage( (sal_uInt16)nPage, PK_STANDARD);
-        mpDoc->SetSelected(pPage, sal_False);
+        SdPage* pPage = mrDoc.GetSdPage( (sal_uInt16)nPage, PK_STANDARD);
+        mrDoc.SetSelected(pPage, sal_False);
 
-        mpOutlineViewShell->UpdateTitleObject( pPage, pPara );
-        mpOutlineViewShell->UpdateOutlineObject( pPage, pPara );
+        mrOutlineViewShell.UpdateTitleObject( pPage, pPara );
+        mrOutlineViewShell.UpdateOutlineObject( pPage, pPara );
 
         if( pPara )
             pPara = GetNextTitle(pPara);
@@ -1709,10 +1701,10 @@ void OutlineView::UpdateDocument()
     while( pPara )
     {
         SdPage* pPage = InsertSlideForParagraph( pPara );
-        mpDoc->SetSelected(pPage, sal_False);
+        mrDoc.SetSelected(pPage, sal_False);
 
-        mpOutlineViewShell->UpdateTitleObject( pPage, pPara );
-        mpOutlineViewShell->UpdateOutlineObject( pPage, pPara );
+        mrOutlineViewShell.UpdateTitleObject( pPage, pPara );
+        mrOutlineViewShell.UpdateOutlineObject( pPage, pPara );
 
         if( pPara )
             pPara = GetNextTitle(pPara);
@@ -1722,7 +1714,7 @@ void OutlineView::UpdateDocument()
 /** merge edit engine undo actions if possible */
 void OutlineView::TryToMergeUndoActions()
 {
-    ::svl::IUndoManager& rOutlineUndo = mpOutliner->GetUndoManager();
+    ::svl::IUndoManager& rOutlineUndo = mrOutliner.GetUndoManager();
     if( rOutlineUndo.GetUndoActionCount() > 1 )
     {
         SfxListUndoAction* pListAction = dynamic_cast< SfxListUndoAction* >( rOutlineUndo.GetUndoAction(0) );
@@ -1834,26 +1826,26 @@ void OutlineView::TryToMergeUndoActions()
 
 IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo)
 {
-    if( pInfo && mpOutliner )
+    if( pInfo )
     {
-        Paragraph* pPara = mpOutliner->GetParagraph( pInfo->mnPara );
-        EditEngine& rEditEngine = const_cast< EditEngine& >( mpOutliner->GetEditEngine() );
+        Paragraph* pPara = mrOutliner.GetParagraph( pInfo->mnPara );
+        EditEngine& rEditEngine = const_cast< EditEngine& >( mrOutliner.GetEditEngine() );
 
         Size aImageSize( pInfo->mpOutDev->PixelToLogic( maSlideImage.GetSizePixel()  ) );
         Size aOffset( 100, 100 );
 
         // paint slide number
-        if( pPara && mpOutliner->HasParaFlag(pPara,PARAFLAG_ISPAGE) )
+        if( pPara && mrOutliner.HasParaFlag(pPara,PARAFLAG_ISPAGE) )
         {
             long nPage = 0; // todo, printing??
             for ( sal_uInt16 n = 0; n <= pInfo->mnPara; n++ )
             {
-                Paragraph* p = mpOutliner->GetParagraph( n );
-                if ( mpOutliner->HasParaFlag(p,PARAFLAG_ISPAGE) )
+                Paragraph* p = mrOutliner.GetParagraph( n );
+                if ( mrOutliner.HasParaFlag(p,PARAFLAG_ISPAGE) )
                     nPage++;
             }
 
-            long nBulletHeight = (long)mpOutliner->GetLineHeight( pInfo->mnPara );
+            long nBulletHeight = (long)mrOutliner.GetLineHeight( pInfo->mnPara );
             long nFontHeight = 0;
             if ( !rEditEngine.IsFlatMode() )
             {
@@ -1879,7 +1871,7 @@ IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo)
 
             pInfo->mpOutDev->DrawImage( aImagePos, aImageSize, maSlideImage );
 
-            const bool bVertical = mpOutliner->IsVertical();
+            const bool bVertical = mrOutliner.IsVertical();
             const bool bRightToLeftPara = rEditEngine.IsRightToLeft( pInfo->mnPara );
 
             LanguageType eLang = rEditEngine.GetDefaultLanguage();
@@ -1923,12 +1915,9 @@ IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo)
 
 void OutlineView::UpdateParagraph( sal_uInt16 nPara )
 {
-    if( mpOutliner )
-    {
-        SfxItemSet aNewAttrs2( mpOutliner->GetParaAttribs( nPara ) );
-        aNewAttrs2.Put( maLRSpaceItem );
-        mpOutliner->SetParaAttribs( nPara, aNewAttrs2 );
-    }
+    SfxItemSet aNewAttrs2( mrOutliner.GetParaAttribs( nPara ) );
+    aNewAttrs2.Put( maLRSpaceItem );
+    mrOutliner.SetParaAttribs( nPara, aNewAttrs2 );
 }
 
 // --------------------------------------------------------------------
@@ -1942,17 +1931,17 @@ void OutlineView::OnBeginPasteOrDrop( PasteOrDropInfos* /*pInfos*/ )
 void OutlineView::OnEndPasteOrDrop( PasteOrDropInfos* pInfos )
 {
     SdPage* pPage = 0;
-    SfxStyleSheetBasePool* pStylePool = GetDoc()->GetStyleSheetPool();
+    SfxStyleSheetBasePool* pStylePool = GetDoc().GetStyleSheetPool();
 
     for( sal_uInt16 nPara = pInfos->nStartPara; nPara <= pInfos->nEndPara; nPara++ )
     {
-        Paragraph* pPara = mpOutliner->GetParagraph( nPara );
+        Paragraph* pPara = mrOutliner.GetParagraph( nPara );
 
-        bool bPage = mpOutliner->HasParaFlag( pPara, PARAFLAG_ISPAGE  );
+        bool bPage = mrOutliner.HasParaFlag( pPara, PARAFLAG_ISPAGE  );
 
         if( !bPage )
         {
-            SdStyleSheet* pStyleSheet = dynamic_cast< SdStyleSheet* >( mpOutliner->GetStyleSheet( nPara ) );
+            SdStyleSheet* pStyleSheet = dynamic_cast< SdStyleSheet* >( mrOutliner.GetStyleSheet( nPara ) );
             if( pStyleSheet )
             {
                 const OUString aName( pStyleSheet->GetApiName() );
@@ -1981,7 +1970,7 @@ void OutlineView::OnEndPasteOrDrop( PasteOrDropInfos* pInfos )
 
                 if( !bPage )
                 {
-                    const sal_Int16 nDepth = mpOutliner->GetDepth( nPara );
+                    const sal_Int16 nDepth = mrOutliner.GetDepth( nPara );
                     if( nDepth > 0 )
                     {
                         String aStyleSheetName( pStyle->GetName() );
@@ -1992,7 +1981,7 @@ void OutlineView::OnEndPasteOrDrop( PasteOrDropInfos* pInfos )
                     }
                 }
 
-                mpOutliner->SetStyleSheet( nPara, pStyle );
+                mrOutliner.SetStyleSheet( nPara, pStyle );
             }
 
             UpdateParagraph( nPara );
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index 98bbb3e..21ba154 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -114,11 +114,11 @@ TYPEINIT1(View, FmFormView);
 |*
 \************************************************************************/
 
-View::View(SdDrawDocument* pDrawDoc, OutputDevice* pOutDev,
+View::View(SdDrawDocument& rDrawDoc, OutputDevice* pOutDev,
                ViewShell* pViewShell)
-  : FmFormView(pDrawDoc, pOutDev),
-    mpDoc(pDrawDoc),
-    mpDocSh( pDrawDoc->GetDocSh() ),
+  : FmFormView(&rDrawDoc, pOutDev),
+    mrDoc(rDrawDoc),
+    mpDocSh(rDrawDoc.GetDocSh()),
     mpViewSh(pViewShell),
     mpDragSrcMarkList(NULL),
     mpDropMarkerObj(NULL),
@@ -499,7 +499,7 @@ void View::CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::contac
             SdPage* pPage = (SdPage*) pPgView->GetPage();
             if( pPage )
             {
-                SdrOutliner& rOutl=mpDoc->GetDrawOutliner(NULL);
+                SdrOutliner& rOutl = mrDoc.GetDrawOutliner(NULL);
                 bool bScreenDisplay(true);
 
                 if(bScreenDisplay && pOutDev && OUTDEV_PRINTER == pOutDev->GetOutDevType())
@@ -703,9 +703,9 @@ sal_Bool View::SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHar
 |*
 \************************************************************************/
 
-static void SetSpellOptions( SdDrawDocument* pDoc, sal_uLong& rCntrl )
+static void SetSpellOptions( const SdDrawDocument& rDoc, sal_uLong& rCntrl )
 {
-    sal_Bool bOnlineSpell = pDoc->GetOnlineSpell();
+    sal_Bool bOnlineSpell = rDoc.GetOnlineSpell();
 
     if( bOnlineSpell )
         rCntrl |= EE_CNTRL_ONLINESPELLING;
@@ -728,7 +728,7 @@ sal_Bool View::SdrBeginTextEdit(
     // make draw&impress specific initialisations
     if( pOutl )
     {
-        pOutl->SetStyleSheetPool((SfxStyleSheetPool*) mpDoc->GetStyleSheetPool());
+        pOutl->SetStyleSheetPool((SfxStyleSheetPool*) mrDoc.GetStyleSheetPool());
         pOutl->SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl));
         sal_uLong nCntrl = pOutl->GetControlWord();
         nCntrl |= EE_CNTRL_ALLOWBIGOBJS;
@@ -737,10 +737,10 @@ sal_Bool View::SdrBeginTextEdit(
         nCntrl |= EE_CNTRL_AUTOCORRECT;
 
         nCntrl &= ~EE_CNTRL_ULSPACESUMMATION;
-        if ( mpDoc->IsSummationOfParagraphs() )
+        if ( mrDoc.IsSummationOfParagraphs() )
             nCntrl |= EE_CNTRL_ULSPACESUMMATION;
 
-        SetSpellOptions( mpDoc, nCntrl );
+        SetSpellOptions( mrDoc, nCntrl );
 
         pOutl->SetControlWord(nCntrl);
 
@@ -868,7 +868,7 @@ bool View::RestoreDefaultText( SdrTextObj* pTextObj )
 
 void View::SetMarkedOriginalSize()
 {
-    SdrUndoGroup*   pUndoGroup = new SdrUndoGroup(*mpDoc);
+    SdrUndoGroup* pUndoGroup = new SdrUndoGroup(mrDoc);
     sal_uLong           nCount = GetMarkedObjectCount();
     sal_Bool            bOK = sal_False;
 
@@ -911,7 +911,7 @@ void View::SetMarkedOriginalSize()
                     {
                         Rectangle   aDrawRect( pObj->GetLogicRect() );
 
-                        pUndoGroup->AddAction( mpDoc->GetSdrUndoFactory().CreateUndoGeoObject( *pObj ) );
+                        pUndoGroup->AddAction( mrDoc.GetSdrUndoFactory().CreateUndoGeoObject( *pObj ) );
                         pObj->Resize( aDrawRect.TopLeft(), Fraction( aOleSize.Width(), aDrawRect.GetWidth() ),
                                                            Fraction( aOleSize.Height(), aDrawRect.GetHeight() ) );
                     }
@@ -974,7 +974,7 @@ void View::DoConnect(SdrOle2Obj* pObj)
                     Size aDrawSize = aRect.GetSize();
                     awt::Size aSz;
 
-                    MapMode aMapMode( mpDoc->GetScaleUnit() );
+                    MapMode aMapMode( mrDoc.GetScaleUnit() );
                     Size aObjAreaSize = pObj->GetOrigObjSize( &aMapMode );
 
                     Fraction aScaleWidth (aDrawSize.Width(),  aObjAreaSize.Width() );
@@ -1021,8 +1021,8 @@ sal_Bool View::IsMorphingAllowed() const
              ( nKind1 != OBJ_CAPTION && nKind2 !=  OBJ_CAPTION ) &&
              !pObj1->ISA( E3dObject) && !pObj2->ISA( E3dObject) )
         {
-            SfxItemSet      aSet1( mpDoc->GetPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE );
-            SfxItemSet      aSet2( mpDoc->GetPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE );
+            SfxItemSet      aSet1( mrDoc.GetPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE );
+            SfxItemSet      aSet2( mrDoc.GetPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE );
 
             aSet1.Put(pObj1->GetMergedItemSet());
             aSet2.Put(pObj2->GetMergedItemSet());
@@ -1133,9 +1133,9 @@ IMPL_LINK( View, OnParagraphRemovingHdl, ::Outliner *, pOutliner )
 
 bool View::isRecordingUndo() const
 {
-    if( mpDoc && mpDoc->IsUndoEnabled() )
+    if( mrDoc.IsUndoEnabled() )
     {
-        sd::UndoManager* pUndoManager = mpDoc ? mpDoc->GetUndoManager() : 0;
+        sd::UndoManager* pUndoManager = mrDoc.GetUndoManager();
         return pUndoManager && pUndoManager->IsInListAction();
     }
     else
@@ -1249,7 +1249,7 @@ void View::OnEndPasteOrDrop( PasteOrDropInfos* pInfos )
         {
             // for outline shapes, set the correct outline style sheet for each
             // new paragraph, depending on the paragraph depth
-            SfxStyleSheetBasePool* pStylePool = GetDoc()->GetStyleSheetPool();
+            SfxStyleSheetBasePool* pStylePool = GetDoc().GetStyleSheetPool();
 
             for ( sal_uInt16 nPara = pInfos->nStartPara; nPara <= pInfos->nEndPara; nPara++ )
             {
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index 59ee92b..634b808 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -123,14 +123,14 @@ struct SdNavigatorDropEvent : public ExecuteDropEvent
 {
     // since SdTransferable::CopyToClipboard is called, this
     // dynamically created object ist destroyed automatically
-    SdTransferable* pTransferable = new SdTransferable( mpDoc, NULL, sal_False );
+    SdTransferable* pTransferable = new SdTransferable( &mrDoc, NULL, sal_False );
     ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > xRet( pTransferable );
 
     SD_MOD()->pTransferClip = pTransferable;
 
-    mpDoc->CreatingDataObj( pTransferable );
+    mrDoc.CreatingDataObj( pTransferable );
     pTransferable->SetWorkDocument( (SdDrawDocument*) GetAllMarkedModel() );
-    mpDoc->CreatingDataObj( NULL );
+    mrDoc.CreatingDataObj( NULL );
 
     // #112978# need to use GetAllMarkedBoundRect instead of GetAllMarkedRect to get
     // fat lines correctly
@@ -187,7 +187,7 @@ struct SdNavigatorDropEvent : public ExecuteDropEvent
 
 ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > View::CreateDragDataObject( View* pWorkView, ::Window& rWindow, const Point& rDragPos )
 {
-    SdTransferable* pTransferable = new SdTransferable( mpDoc, pWorkView, sal_False );
+    SdTransferable* pTransferable = new SdTransferable( &mrDoc, pWorkView, sal_False );
     ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > xRet( pTransferable );
 
     SD_MOD()->pTransferDrag = pTransferable;
@@ -238,7 +238,7 @@ struct SdNavigatorDropEvent : public ExecuteDropEvent
 
 ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > View::CreateSelectionDataObject( View* pWorkView, ::Window& rWindow )
 {
-    SdTransferable*                 pTransferable = new SdTransferable( mpDoc, pWorkView, sal_True );
+    SdTransferable*                 pTransferable = new SdTransferable( &mrDoc, pWorkView, sal_True );
     ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > xRet( pTransferable );
     TransferableObjectDescriptor    aObjDesc;
     const Rectangle                 aMarkRect( GetAllMarkedRect() );
@@ -355,10 +355,10 @@ void View::DoPaste (::Window* pWindow)
                 }
             }
 
-            if( !mpDoc->IsChanged() )
+            if( !mrDoc.IsChanged() )
             {
                 if( pOutliner && pOutliner->IsModified() )
-                    mpDoc->SetChanged( sal_True );
+                    mrDoc.SetChanged( sal_True );
             }
         }
     }
@@ -455,7 +455,7 @@ void View::DragFinished( sal_Int8 nDropAction )
             nm--;
             SdrMark* pM=mpDragSrcMarkList->GetMark(nm);
             if( bUndo )
-                AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeleteObject(*pM->GetMarkedSdrObj()));
+                AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoDeleteObject(*pM->GetMarkedSdrObj()));
         }
 
         mpDragSrcMarkList->GetMark(0)->GetMarkedSdrObj()->GetOrdNum();
@@ -503,7 +503,7 @@ sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTarge
 
     if( nLayer != SDRLAYER_NOTFOUND )
     {
-        SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin();
+        SdrLayerAdmin& rLayerAdmin = mrDoc.GetLayerAdmin();
         aLayerName = rLayerAdmin.GetLayerPerID(nLayer)->GetName();
     }
 
@@ -732,7 +732,7 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTar
 
                             if( aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_XFA, xStm ) && xStm.Is() )
                             {
-                                XFillExchangeData aFillData( XFillAttrSetItem( &mpDoc->GetPool() ) );
+                                XFillExchangeData aFillData( XFillAttrSetItem( &mrDoc.GetPool() ) );
 
                                 *xStm >> aFillData;
                                 const Color aColor( ( (XFillColorItem&) aFillData.GetXFillAttrSetItem()->GetItemSet().Get( XATTR_FILLCOLOR ) ).GetColorValue() );
@@ -779,7 +779,7 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTar
                         {
                             // insert as clip action => jump
                             rtl::OUString       aBookmark( aINetBookmark.GetURL() );
-                            SdAnimationInfo*    pInfo = mpDoc->GetAnimationInfo( pPickObj );
+                            SdAnimationInfo*    pInfo = mrDoc.GetAnimationInfo( pPickObj );
                             sal_Bool                bCreated = sal_False;
 
                             if( !aBookmark.isEmpty() )
@@ -806,7 +806,7 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTar
                                 }
 
                                 // Undo-Action mit alten und neuen Groessen erzeugen
-                                SdAnimationPrmsUndoAction* pAction = new SdAnimationPrmsUndoAction(mpDoc, pPickObj, bCreated);
+                                SdAnimationPrmsUndoAction* pAction = new SdAnimationPrmsUndoAction(&mrDoc, pPickObj, bCreated);
                                 pAction->SetActive(pInfo->mbActive, pInfo->mbActive);
                                 pAction->SetEffect(pInfo->meEffect, pInfo->meEffect);
                                 pAction->SetTextEffect(pInfo->meTextEffect, pInfo->meTextEffect);
@@ -831,7 +831,7 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTar
                                 mpDocSh->GetUndoManager()->AddUndoAction(pAction);
                                 pInfo->meClickAction = eClickAction;
                                 pInfo->SetBookmark( aBookmark );
-                                mpDoc->SetChanged();
+                                mrDoc.SetChanged();
 
                                 nRet = nDropAction;
                             }
@@ -897,7 +897,7 @@ IMPL_LINK( View, ExecuteNavigatorDrop, SdNavigatorDropEvent*, pSdNavigatorDropEv
         // Sollten Seitennamen und Objektnamen identisch sein gibt es hier natuerlich Probleme !!!
         if( bNameOK )
         {
-            mpDoc->InsertBookmark( &aBookmarkList, pExchangeList,
+            mrDoc.InsertBookmark( &aBookmarkList, pExchangeList,
                                   bLink, bReplace, nPgPos, sal_False,
                                   &pPageObjsTransferable->GetDocShell(),
                                   sal_True, &aPos );
@@ -952,7 +952,7 @@ sal_Bool View::GetExchangeList( List*& rpExchangeList, List* pBookmarkList, sal_
 
             if( bNameOK && ( nType == 1  || nType == 2 ) )
             {
-                if( mpDoc->GetObj( *pNewName ) )
+                if( mrDoc.GetObj( *pNewName ) )
                 {
                     String          aTitle( SdResId( STR_TITLE_NAMEGROUP ) );
                     String          aDesc( SdResId( STR_DESC_NAMEGROUP ) );
@@ -969,7 +969,7 @@ sal_Bool View::GetExchangeList( List*& rpExchangeList, List* pBookmarkList, sal_
                         {
                             pDlg->GetName( *pNewName );
 
-                            if( !mpDoc->GetObj( *pNewName ) )
+                            if( !mrDoc.GetObj( *pNewName ) )
                                 bNameOK = sal_True;
                         }
 
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index 48e2231..78e3a3b 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -298,7 +298,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
     }
 
     if( nPage != SDRPAGE_NOTFOUND )
-        pPage = (SdPage*) mpDoc->GetPage( nPage );
+        pPage = (SdPage*) mrDoc.GetPage( nPage );
 
     SdTransferable* pOwnData = NULL;
     SdTransferable* pImplementation = SdTransferable::getImplementation( aDataHelper.GetTransferable() );
@@ -372,7 +372,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
                 if( nLayer != SDRLAYER_NOTFOUND )
                 {
                     // drop on layer tab bar
-                    SdrLayerAdmin&  rLayerAdmin = mpDoc->GetLayerAdmin();
+                    SdrLayerAdmin&  rLayerAdmin = mrDoc.GetLayerAdmin();
                     SdrLayer*       pLayer = rLayerAdmin.GetLayerPerID( nLayer );
                     SdrPageView*    pPV = GetSdrPageView();
                     String          aLayer( pLayer->GetName() );
@@ -715,8 +715,8 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
                             pWorkPage->InsertObject( pNewObj );
                             if( bUndo )
                             {
-                                AddUndo( mpDoc->GetSdrUndoFactory().CreateUndoNewObject( *pNewObj ) );
-                                AddUndo( mpDoc->GetSdrUndoFactory().CreateUndoDeleteObject( *pPickObj2 ) );
+                                AddUndo( mrDoc.GetSdrUndoFactory().CreateUndoNewObject( *pNewObj ) );
+                                AddUndo( mrDoc.GetSdrUndoFactory().CreateUndoDeleteObject( *pPickObj2 ) );
                             }
                             pWorkPage->RemoveObject( pPickObj2->GetOrdNum() );
 
@@ -733,14 +733,14 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
                         }
                         else if( ( mnAction & DND_ACTION_LINK ) && pPickObj && pObj && !pPickObj->ISA( SdrGrafObj ) && !pPickObj->ISA( SdrOle2Obj ) )
                         {
-                            SfxItemSet aSet( mpDoc->GetPool() );
+                            SfxItemSet aSet( mrDoc.GetPool() );
 
                             // set new attributes to object
                             const bool bUndo = IsUndoEnabled();
                             if( bUndo )
                             {
                                 BegUndo( String( SdResId( STR_UNDO_DRAGDROP ) ) );
-                                AddUndo( mpDoc->GetSdrUndoFactory().CreateUndoAttrObject( *pPickObj ) );
+                                AddUndo( mrDoc.GetSdrUndoFactory().CreateUndoAttrObject( *pPickObj ) );
                             }
                             aSet.Put( pObj->GetMergedItemSet() );
 
@@ -755,14 +755,14 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
                             if( pPickObj->ISA( E3dObject ) && pObj->ISA( E3dObject ) )
                             {
                                 // Zusaetzlich 3D Attribute handeln
-                                SfxItemSet aNewSet( mpDoc->GetPool(), SID_ATTR_3D_START, SID_ATTR_3D_END, 0 );
-                                SfxItemSet aOldSet( mpDoc->GetPool(), SID_ATTR_3D_START, SID_ATTR_3D_END, 0 );
+                                SfxItemSet aNewSet( mrDoc.GetPool(), SID_ATTR_3D_START, SID_ATTR_3D_END, 0 );
+                                SfxItemSet aOldSet( mrDoc.GetPool(), SID_ATTR_3D_START, SID_ATTR_3D_END, 0 );
 
                                 aOldSet.Put(pPickObj->GetMergedItemSet());
                                 aNewSet.Put( pObj->GetMergedItemSet() );
 
                                 if( bUndo )
-                                    AddUndo( new E3dAttributesUndoAction( *mpDoc, this, (E3dObject*) pPickObj, aNewSet, aOldSet, sal_False ) );
+                                    AddUndo( new E3dAttributesUndoAction( mrDoc, this, (E3dObject*) pPickObj, aNewSet, aOldSet, sal_False ) );
                                 pPickObj->SetMergedItemSetAndBroadcast( aNewSet );
                             }
 
@@ -831,10 +831,10 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
             ( aDataHelper.GetInputStream( nFormat ? nFormat : SOT_FORMATSTR_ID_EMBED_SOURCE, xStm ) ||
               aDataHelper.GetInputStream( SOT_FORMATSTR_ID_EMBEDDED_OBJ, xStm ) ) )
         {
-            if( mpDoc->GetDocSh() && ( mpDoc->GetDocSh()->GetClassName() == aObjDesc.maClassName ) )
+            if( mrDoc.GetDocSh() && ( mrDoc.GetDocSh()->GetClassName() == aObjDesc.maClassName ) )
             {
                 uno::Reference < embed::XStorage > xStore( ::comphelper::OStorageHelper::GetStorageFromInputStream( xStm ) );
-                ::sd::DrawDocShellRef xDocShRef( new ::sd::DrawDocShell( SFX_CREATE_MODE_EMBEDDED, sal_True, mpDoc->GetDocumentType() ) );
+                ::sd::DrawDocShellRef xDocShRef( new ::sd::DrawDocShell( SFX_CREATE_MODE_EMBEDDED, sal_True, mrDoc.GetDocumentType() ) );
 
                 // mba: BaseURL doesn't make sense for clipboard functionality
                 SfxMedium *pMedium = new SfxMedium( xStore, String() );
@@ -945,7 +945,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
                         aSize = OutputDevice::LogicToLogic( aSize, aMapUnit, MAP_100TH_MM );
                     }
 
-                    Size aMaxSize( mpDoc->GetMaxObjSize() );
+                    Size aMaxSize( mrDoc.GetMaxObjSize() );
 
                     maDropPos.X() -= Min( aSize.Width(), aMaxSize.Width() ) >> 1;
                     maDropPos.Y() -= Min( aSize.Height(), aMaxSize.Height() ) >> 1;
@@ -1115,7 +1115,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
                         aSize = OutputDevice::LogicToLogic( aSize, aMapUnit, MAP_100TH_MM );
                     }
 
-                    Size aMaxSize( mpDoc->GetMaxObjSize() );
+                    Size aMaxSize( mrDoc.GetMaxObjSize() );
 
                     maDropPos.X() -= Min( aSize.Width(), aMaxSize.Width() ) >> 1;
                     maDropPos.Y() -= Min( aSize.Height(), aMaxSize.Height() ) >> 1;
@@ -1250,7 +1250,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
 
         if( aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_XFA, xStm ) )
         {
-            XFillExchangeData aFillData( XFillAttrSetItem( &mpDoc->GetPool() ) );
+            XFillExchangeData aFillData( XFillAttrSetItem( &mrDoc.GetPool() ) );
 
             *xStm >> aFillData;
 
@@ -1270,7 +1270,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
                 const XFillColorItem&   rColItem = (XFillColorItem&) rSet.Get( XATTR_FILLCOLOR );
                 Color                   aColor( rColItem.GetColorValue() );
                 String                  aName( rColItem.GetName() );
-                SfxItemSet              aSet( mpDoc->GetPool() );
+                SfxItemSet              aSet( mrDoc.GetPool() );
                 sal_Bool                    bClosed = pPickObj->IsClosedObj();
                 ::sd::Window* pWin = mpViewSh->GetActiveWindow();
                 sal_uInt16 nHitLog = (sal_uInt16) pWin->PixelToLogic(
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 9b686bc..afc2eb9 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -252,8 +252,8 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
             pP->InsertObject(pNewGrafObj);
             if( bUndo )
             {
-                AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoNewObject(*pNewGrafObj));
-                AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeleteObject(*pPickObj));
+                AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoNewObject(*pNewGrafObj));
+                AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoDeleteObject(*pPickObj));
             }
             pP->RemoveObject(pPickObj->GetOrdNum());
 
@@ -295,7 +295,7 @@ SdrMediaObj* View::InsertMediaURL( const rtl::OUString& rMediaURL, sal_Int8& rAc
     else
     {
         uno::Reference<frame::XModel> const xModel(
-                GetDoc()->GetObjectShell()->GetModel());
+                GetDoc().GetObjectShell()->GetModel());
         bool const bRet = ::avmedia::EmbedMedia(xModel, rMediaURL, realURL);
         if (!bRet) { return 0; }
     }
@@ -444,12 +444,12 @@ IMPL_LINK( View, DropInsertFileHdl, Timer*, EMPTYARG )
                         aLowerAsciiFileName.SearchAscii(".sti") != STRING_NOTFOUND )
                     {
                         ::sd::Window* pWin = mpViewSh->GetActiveWindow();
-                        SfxRequest      aReq(SID_INSERTFILE, 0, mpDoc->GetItemPool());
+                        SfxRequest      aReq(SID_INSERTFILE, 0, mrDoc.GetItemPool());
                         SfxStringItem   aItem1( ID_VAL_DUMMY0, aCurrentDropFile ), aItem2( ID_VAL_DUMMY1, pFoundFilter->GetFilterName() );
 
                         aReq.AppendItem( aItem1 );
                         aReq.AppendItem( aItem2 );
-                        FuInsertFile::Create( mpViewSh, pWin, this, mpDoc, aReq );
+                        FuInsertFile::Create( mpViewSh, pWin, this, &mrDoc, aReq );
                         bOK = sal_True;
                     }
                 }


More information about the Libreoffice-commits mailing list