[Libreoffice-commits] core.git: Branch 'feature/refactor-god-objects' - 2 commits - sw/inc sw/source

Valentin Kettner vakevk+libreoffice at gmail.com
Fri May 23 05:53:33 PDT 2014


 sw/inc/doc.hxx                                            |   89 --------------
 sw/source/core/doc/DocumentSettingManager.cxx             |   27 +++-
 sw/source/core/doc/doc.cxx                                |    8 -
 sw/source/core/doc/docdraw.cxx                            |    2 
 sw/source/core/doc/docnew.cxx                             |   16 --
 sw/source/core/docnode/node.cxx                           |    2 
 sw/source/core/inc/DocumentSettingManager.hxx             |   67 ++++++++++
 sw/source/core/uibase/app/docsh.cxx                       |   14 +-
 sw/source/core/uibase/app/docsh2.cxx                      |    8 -
 sw/source/core/uibase/app/docshini.cxx                    |    8 -
 sw/source/core/uibase/dialog/SwSpellDialogChildWindow.cxx |    2 
 sw/source/core/uibase/lingu/sdrhhcwrap.cxx                |    2 
 sw/source/core/uibase/misc/glshell.cxx                    |    4 
 sw/source/core/uibase/uiview/srcview.cxx                  |    4 
 sw/source/core/uibase/uno/SwXDocumentSettings.cxx         |   12 -
 sw/source/core/uibase/uno/unomod.cxx                      |    4 
 sw/source/core/uibase/uno/unotxdoc.cxx                    |    8 -
 sw/source/core/unocore/unostyle.cxx                       |    8 -
 sw/source/core/view/printdata.cxx                         |    2 
 sw/source/core/view/viewsh.cxx                            |    6 
 sw/source/core/view/vnew.cxx                              |    4 
 sw/source/core/view/vprint.cxx                            |    2 
 sw/source/filter/ascii/parasc.cxx                         |    4 
 sw/source/filter/basflt/shellio.cxx                       |    4 
 sw/source/filter/ww8/wrtww8.cxx                           |    5 
 sw/source/filter/ww8/ww8par.cxx                           |    5 
 sw/source/filter/xml/xmlimp.cxx                           |    2 
 sw/source/ui/dialog/ascfldlg.cxx                          |    2 
 28 files changed, 159 insertions(+), 162 deletions(-)

New commits:
commit 8a4911d8c2aa5b45462569d0e42fc2d8e69d4b43
Author: Valentin Kettner <vakevk+libreoffice at gmail.com>
Date:   Fri May 23 14:43:48 2014 +0200

    Work on DocumentSettingManager for SwDoc.
    
    Moved mn32DummyCompatabilityOptions1 from SwDoc to DocumentSettingManager
    and moved a comment from SwDoc to it.
    
    Change-Id: I4abd5cd9596d23dc3ac12460ee9b38345d0bf0a7

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 87e008f..21bb0b0 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -463,73 +463,6 @@ private:
     //       Thus, certain adjustment needed during formatting for these kind of anchored objects.
     bool mbContainsAtPageObjWithContentAnchor : 1;
 
-    // COMPATIBILITY FLAGS START
-    //
-    //
-    // HISTORY OF THE COMPATIBILITY FLAGS:
-    //
-    // SO5:
-    // mbParaSpaceMax                        def = sal_False, sal_True since SO8
-    // mbParaSpaceMaxAtPages                 def = sal_False, sal_True since SO8
-    //
-    // SO6:
-    // mbTabCompat                           def = sal_False, sal_True since SO8
-    //
-    // SO7:
-    // mbUseVirtualDevice                    def = sal_True
-    // mbAddFlyOffsets                       def = sal_False, hidden
-    //
-    // SO7pp1:
-    // bOldNumbering                        def = sal_False, hidden
-    //
-    // SO8:
-    // mbAddExternalLeading                  def = sal_True
-    // mbUseHiResolutionVirtualDevice        def = sal_True, hidden
-    // mbOldLineSpacing                      def = sal_False
-    // mbAddParaSpacingToTableCells          def = sal_True
-    // mbUseFormerObjectPos                  def = sal_False
-    // mbUseFormerTextWrapping               def = sal_False
-    // mbConsiderWrapOnObjPos                def = sal_False
-    //
-    // SO8pp1:
-    // mbIgnoreFirstLineIndentInNumbering    def = sal_False, hidden
-    // mbDoNotJustifyLinesWithManualBreak    def = sal_False, hidden
-    // mbDoNotResetParaAttrsForNumFont       def = sal_False, hidden
-    //
-    // SO8pp3
-    // mbDoNotCaptureDrawObjsOnPage         def = sal_False, hidden
-    // - Relevant for drawing objects, which don't follow the text flow, but
-    //   whose position is outside the page area:
-    //   sal_False: Such drawing objects are captured on the page area of its anchor.
-    //   sal_True: Such drawing objects can leave the page area, they aren't captured.
-    // mbTableRowKeep                            def = sal_False, hidden
-    // mbIgnoreTabsAndBlanksForLineCalculation   def = sal_False, hidden
-    // mbClipAsCharacterAnchoredWriterFlyFrame   def = sal_False, hidden
-    // - Introduced in order to re-activate clipping of as-character anchored
-    //   Writer fly frames in method <SwFlyInCntFrm::MakeAll()> for documents,
-    //   which are created with version prior SO8/OOo 2.0
-    //
-    // SO8pp4
-    // mbUnixForceZeroExtLeading                def = sal_False, hidden
-    //
-    // SO8pu8
-    // mbOldPrinterMetrics                      def = sal_False, hidden
-    //
-    // SO9
-    // #i24363# tab stops relative to indent
-    // mbTabRelativeToIndent                    def = sal_True, hidden
-    // #i89181# suppress tab stop at left indent for paragraphs in lists, whose
-    // list level position and space mode equals LABEL_ALIGNMENT and whose list
-    // label is followed by a tab character.
-    // mbTabAtLeftIndentForParagraphsInList     def = sal_False, hidden
-
-    // non-ui-compatibility flags:
-    bool mbOldPrinterMetrics                        : 1;
-
-    sal_uInt32  mn32DummyCompatabilityOptions1;
-    sal_uInt32  mn32DummyCompatabilityOptions2;
-    // COMPATIBILITY FLAGS END
-
     bool mbStartIdleTimer;                    //< idle timer mode start/stop
 
     static SwAutoCompleteWord *mpACmpltWords;  //< List of all words for AutoComplete
@@ -1989,22 +1922,6 @@ public:
     void SetDefaultPageMode(bool bSquaredPageMode);
     bool IsSquaredPageMode() const;
 
-    void Setn32DummyCompatabilityOptions1( const sal_uInt32 CompatabilityOptions1 )
-    {
-        mn32DummyCompatabilityOptions1 = CompatabilityOptions1;
-    }
-    sal_uInt32 Getn32DummyCompatabilityOptions1()
-    {
-        return mn32DummyCompatabilityOptions1;
-    }
-    void Setn32DummyCompatabilityOptions2( const sal_uInt32 CompatabilityOptions2 )
-    {
-        mn32DummyCompatabilityOptions2 = CompatabilityOptions2;
-    }
-    sal_uInt32 Getn32DummyCompatabilityOptions2()
-    {
-        return mn32DummyCompatabilityOptions2;
-    }
     com::sun::star::uno::Reference< com::sun::star::script::vba::XVBAEventProcessor > GetVbaEventProcessor();
     void SetVBATemplateToProjectCache( com::sun::star::uno::Reference< com::sun::star::container::XNameContainer >& xCache ) { m_xTemplateToProjectCache = xCache; };
         com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > GetVBATemplateToProjectCache() { return m_xTemplateToProjectCache; };
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx
index 8c5a88b..138c209 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -33,11 +33,12 @@
 /* IDocumentSettingAccess */
 
 sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc)
-    :m_rDoc(rDoc)
-    ,
+    :m_rDoc(rDoc),
     mnLinkUpdMode( GLOBALSETTING ),
     meFldUpdMode( AUTOUPD_GLOBALSETTING ),
     meChrCmprType( CHARCOMPRESS_NONE ),
+    mn32DummyCompatabilityOptions1(0),
+    mn32DummyCompatabilityOptions2(0),
     mbHTMLMode(false),
     mbIsGlobalDoc(false),
     mbGlblDocSaveLinks(false),
@@ -475,6 +476,9 @@ void sw::DocumentSettingManager::setCharacterCompressionType( /*[in]*/SwCharComp
 
 void sw::DocumentSettingManager::ReplaceCompatabilityOptions(const DocumentSettingManager& rSource)
 {
+    Setn32DummyCompatabilityOptions1( rSource.Getn32DummyCompatabilityOptions1() );
+    Setn32DummyCompatabilityOptions2( rSource.Getn32DummyCompatabilityOptions2() );
+
     mbParaSpaceMax = rSource.mbParaSpaceMax;
     mbParaSpaceMaxAtPages = rSource.mbParaSpaceMaxAtPages;
     mbTabCompat = rSource.mbTabCompat;
@@ -501,4 +505,23 @@ void sw::DocumentSettingManager::ReplaceCompatabilityOptions(const DocumentSetti
     mbTabAtLeftIndentForParagraphsInList = rSource.mbTabAtLeftIndentForParagraphsInList;
 }
 
+sal_uInt32 sw::DocumentSettingManager::Getn32DummyCompatabilityOptions1() const
+{
+    return mn32DummyCompatabilityOptions1;
+}
+
+void sw::DocumentSettingManager::Setn32DummyCompatabilityOptions1( const sal_uInt32 CompatabilityOptions1 )
+{
+    mn32DummyCompatabilityOptions1 = CompatabilityOptions1;
+}
+
+sal_uInt32 sw::DocumentSettingManager::Getn32DummyCompatabilityOptions2() const
+{
+    return mn32DummyCompatabilityOptions2;
+}
+
+void sw::DocumentSettingManager::Setn32DummyCompatabilityOptions2( const sal_uInt32 CompatabilityOptions2 )
+{
+    mn32DummyCompatabilityOptions2 = CompatabilityOptions2;
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 94bd30e..90f8eae 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -276,14 +276,6 @@ SwDoc::SwDoc()
 #endif
     mbContainsAtPageObjWithContentAnchor(false), //#i119292#, fdo#37024
 
-    // COMPATIBILITY FLAGS START
-
-    mbOldPrinterMetrics(false),
-    mn32DummyCompatabilityOptions1(0),
-    mn32DummyCompatabilityOptions2(0),
-
-    // COMPATIBILITY FLAGS END
-
     mbStartIdleTimer(false),
     mbReadOnly(false),
     meDocType(DOCTYPE_NATIVE)
@@ -1017,10 +1009,6 @@ void SwDoc::ReplaceDefaults(const SwDoc& rSource)
 
 void SwDoc::ReplaceCompatabilityOptions(const SwDoc& rSource)
 {
-    mn32DummyCompatabilityOptions1 = rSource.mn32DummyCompatabilityOptions1;
-    mn32DummyCompatabilityOptions2 = rSource.mn32DummyCompatabilityOptions2;
-    mbOldPrinterMetrics = rSource.mbOldPrinterMetrics;
-
     m_pDocumentSettingManager->ReplaceCompatabilityOptions(rSource.GetDocumentSettingManager());
 }
 
diff --git a/sw/source/core/inc/DocumentSettingManager.hxx b/sw/source/core/inc/DocumentSettingManager.hxx
index 82a47f4..4c99a1d 100644
--- a/sw/source/core/inc/DocumentSettingManager.hxx
+++ b/sw/source/core/inc/DocumentSettingManager.hxx
@@ -34,6 +34,68 @@ class DocumentSettingManager :
     SwFldUpdateFlags    meFldUpdMode;//< Automatically Update Mode for fields/charts.
     SwCharCompressType meChrCmprType;//< for ASIAN: compress punctuation/kana
 
+    sal_uInt32  mn32DummyCompatabilityOptions1;
+    sal_uInt32  mn32DummyCompatabilityOptions2;
+
+    // COMPATIBILITY FLAGS START
+    //
+    //
+    // HISTORY OF THE COMPATIBILITY FLAGS:
+    //
+    // SO5:
+    // mbParaSpaceMax                        def = sal_False, sal_True since SO8
+    // mbParaSpaceMaxAtPages                 def = sal_False, sal_True since SO8
+    //
+    // SO6:
+    // mbTabCompat                           def = sal_False, sal_True since SO8
+    //
+    // SO7:
+    // mbUseVirtualDevice                    def = sal_True
+    // mbAddFlyOffsets                       def = sal_False, hidden
+    //
+    // SO7pp1:
+    // bOldNumbering                        def = sal_False, hidden
+    //
+    // SO8:
+    // mbAddExternalLeading                  def = sal_True
+    // mbUseHiResolutionVirtualDevice        def = sal_True, hidden
+    // mbOldLineSpacing                      def = sal_False
+    // mbAddParaSpacingToTableCells          def = sal_True
+    // mbUseFormerObjectPos                  def = sal_False
+    // mbUseFormerTextWrapping               def = sal_False
+    // mbConsiderWrapOnObjPos                def = sal_False
+    //
+    // SO8pp1:
+    // mbIgnoreFirstLineIndentInNumbering    def = sal_False, hidden
+    // mbDoNotJustifyLinesWithManualBreak    def = sal_False, hidden
+    // mbDoNotResetParaAttrsForNumFont       def = sal_False, hidden
+    //
+    // SO8pp3
+    // mbDoNotCaptureDrawObjsOnPage         def = sal_False, hidden
+    // - Relevant for drawing objects, which don't follow the text flow, but
+    //   whose position is outside the page area:
+    //   sal_False: Such drawing objects are captured on the page area of its anchor.
+    //   sal_True: Such drawing objects can leave the page area, they aren't captured.
+    // mbTableRowKeep                            def = sal_False, hidden
+    // mbIgnoreTabsAndBlanksForLineCalculation   def = sal_False, hidden
+    // mbClipAsCharacterAnchoredWriterFlyFrame   def = sal_False, hidden
+    // - Introduced in order to re-activate clipping of as-character anchored
+    //   Writer fly frames in method <SwFlyInCntFrm::MakeAll()> for documents,
+    //   which are created with version prior SO8/OOo 2.0
+    //
+    // SO8pp4
+    // mbUnixForceZeroExtLeading                def = sal_False, hidden
+    //
+    // SO8pu8
+    //
+    // SO9
+    // #i24363# tab stops relative to indent
+    // mbTabRelativeToIndent                    def = sal_True, hidden
+    // #i89181# suppress tab stop at left indent for paragraphs in lists, whose
+    // list level position and space mode equals LABEL_ALIGNMENT and whose list
+    // label is followed by a tab character.
+    // mbTabAtLeftIndentForParagraphsInList     def = sal_False, hidden
+
     bool mbHTMLMode              : 1;    //< TRUE: Document is in HTMLMode.
     bool mbIsGlobalDoc           : 1;    //< TRUE: It's a global document.
     bool mbGlblDocSaveLinks      : 1;    //< TRUE: Save sections linked in global document.
@@ -111,6 +173,11 @@ public:
 // Replace all compatability options with those from rSource.
     void ReplaceCompatabilityOptions(const DocumentSettingManager& rSource);
 
+    sal_uInt32 Getn32DummyCompatabilityOptions1() const;
+    void Setn32DummyCompatabilityOptions1( const sal_uInt32 CompatabilityOptions1 );
+    sal_uInt32 Getn32DummyCompatabilityOptions2() const;
+    void Setn32DummyCompatabilityOptions2( const sal_uInt32 CompatabilityOptions2 );
+
 };
 
 }
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 409eb82..a94765c 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -58,6 +58,7 @@
 #include <fmtrowsplt.hxx>
 #include <frmatr.hxx>
 #include <doc.hxx>
+#include <DocumentSettingManager.hxx>
 #include <viewopt.hxx>
 #include <docary.hxx>
 #include <pam.hxx>
@@ -323,8 +324,8 @@ static void WriteDop( WW8Export& rWrt )
     WW8Dop& rDop = *rWrt.pDop;
 
     // i#78951#, store the value of unknown compatability options
-    rDop.SetCompatabilityOptions( rWrt.pDoc->Getn32DummyCompatabilityOptions1());
-    rDop.SetCompatabilityOptions2( rWrt.pDoc->Getn32DummyCompatabilityOptions2());
+    rDop.SetCompatabilityOptions( rWrt.pDoc->GetDocumentSettingManager().Getn32DummyCompatabilityOptions1());
+    rDop.SetCompatabilityOptions2( rWrt.pDoc->GetDocumentSettingManager().Getn32DummyCompatabilityOptions2());
 
     rDop.fNoLeading = !rWrt.pDoc->get(IDocumentSettingAccess::ADD_EXT_LEADING);
     rDop.fUsePrinterMetrics = !rWrt.pDoc->get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE);
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 41bfc4f..1cd2136 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -83,6 +83,7 @@
 #include <swtable.hxx>
 #include <fchrfmt.hxx>
 #include <charfmt.hxx>
+#include <DocumentSettingManager.hxx>
 
 #include <fltini.hxx>
 
@@ -1843,8 +1844,8 @@ void SwWW8ImplReader::ImportDop()
 
     // #i78951# - remember the unknown compatibility options
     // so as to export them out
-    rDoc.Setn32DummyCompatabilityOptions1( pWDop->GetCompatabilityOptions());
-    rDoc.Setn32DummyCompatabilityOptions2( pWDop->GetCompatabilityOptions2());
+    rDoc.GetDocumentSettingManager().Setn32DummyCompatabilityOptions1( pWDop->GetCompatabilityOptions());
+    rDoc.GetDocumentSettingManager().Setn32DummyCompatabilityOptions2( pWDop->GetCompatabilityOptions2());
 
     // The distance between two paragraphs is the sum of the bottom distance of
     // the first paragraph and the top distance of the second one
commit f2fea9545b8861668ca7c3e7a41e223bbc574b75
Author: Valentin Kettner <vakevk+libreoffice at gmail.com>
Date:   Wed May 21 17:39:52 2014 +0200

    Made SwDoc::getDocumentDeviceAccess return a reference.
    
    Also overloaded SwDoc::getDocumentDeviceAccess with its const
    version.
    
    Change-Id: I3272be3ee067aa2e0174663ede3c98190ecf2b09

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 1a6ac30..87e008f 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -272,7 +272,6 @@ class SW_DLLPUBLIC SwDoc :
 
     // private Member
     ::boost::scoped_ptr<SwNodes> m_pNodes;  //< document content (Nodes Array)
-    ::boost::scoped_ptr< ::sw::DocumentDeviceManager > m_DeviceAccess;
     SwAttrPool* mpAttrPool;             //< the attribute pool
     SwPageDescs maPageDescs;             //< PageDescriptors
     Link        maOle2Link;              //< OLE 2.0-notification
@@ -294,6 +293,7 @@ class SW_DLLPUBLIC SwDoc :
     const ::boost::scoped_ptr< ::sw::MetaFieldManager > m_pMetaFieldManager;
     const ::boost::scoped_ptr< ::sw::UndoManager > m_pUndoManager;
     const ::boost::scoped_ptr< ::sw::DocumentSettingManager > m_pDocumentSettingManager;
+    ::boost::scoped_ptr< ::sw::DocumentDeviceManager > m_pDeviceAccess;
 
     // Pointer
     SwFrmFmt        *mpDfltFrmFmt;       //< Default formats.
@@ -677,8 +677,8 @@ public:
     virtual void setRsidRoot( sal_uInt32 nVal );
 
     // IDocumentDeviceAccess
-    const IDocumentDeviceAccess* getIDocumentDeviceAccessConst() const;
-    IDocumentDeviceAccess* getIDocumentDeviceAccess();
+    IDocumentDeviceAccess const & getIDocumentDeviceAccess() const;
+    IDocumentDeviceAccess & getIDocumentDeviceAccess();
 
     // IDocumentMarkAccess
     IDocumentMarkAccess* getIDocumentMarkAccess();
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index efdd2df..15be104 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -244,14 +244,14 @@ void SwDoc::setCharacterCompressionType( /*[in]*/SwCharCompressType n )
 }
 
 // IDocumentDeviceAccess
-const IDocumentDeviceAccess* SwDoc::getIDocumentDeviceAccessConst() const
+IDocumentDeviceAccess const & SwDoc::getIDocumentDeviceAccess() const
 {
-    return m_DeviceAccess.get();
+    return *m_pDeviceAccess;
 }
 
-IDocumentDeviceAccess* SwDoc::getIDocumentDeviceAccess()
+IDocumentDeviceAccess & SwDoc::getIDocumentDeviceAccess()
 {
-    return m_DeviceAccess.get();
+    return *m_pDeviceAccess;
 }
 
 
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index c3e7ee6..8b7e1ba 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -596,7 +596,7 @@ void SwDoc::InitDrawModel()
     mpDrawModel->SetLinkManager( &GetLinkManager() );
     mpDrawModel->SetAddExtLeading( get(IDocumentSettingAccess::ADD_EXT_LEADING) );
 
-    OutputDevice* pRefDev = getIDocumentDeviceAccessConst()->getReferenceDevice( false );
+    OutputDevice* pRefDev = getIDocumentDeviceAccess().getReferenceDevice( false );
     if ( pRefDev )
         mpDrawModel->SetRefDevice( pRefDev );
 
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index d42dd9f..94bd30e 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -184,13 +184,13 @@ static void lcl_DelFmtIndices( SwFmt* pFmt )
  */
 SwDoc::SwDoc()
     : m_pNodes( new SwNodes(this) ),
-    m_DeviceAccess( new ::sw::DocumentDeviceManager( *this ) ),
     mpAttrPool(new SwAttrPool(this)),
     mpMarkManager(new ::sw::mark::MarkManager(*this)),
     m_pMetaFieldManager(new ::sw::MetaFieldManager()),
     m_pUndoManager(new ::sw::UndoManager(
             boost::shared_ptr<SwNodes>(new SwNodes(this)), *this, *this, *this)),
     m_pDocumentSettingManager(new ::sw::DocumentSettingManager(*this)),
+    m_pDeviceAccess( new ::sw::DocumentDeviceManager( *this ) ),
     mpDfltFrmFmt( new SwFrmFmt( GetAttrPool(), sFrmFmtStr, 0 ) ),
     mpEmptyPageFmt( new SwFrmFmt( GetAttrPool(), sEmptyPageStr, mpDfltFrmFmt ) ),
     mpColumnContFmt( new SwFrmFmt( GetAttrPool(), sColumnCntStr, mpDfltFrmFmt ) ),
@@ -578,7 +578,7 @@ SwDoc::~SwDoc()
     // Without explicitly freeing the DocumentDeviceManager
     // and relying on the implicit freeing there would be a crash
     // due to it happening after SwAttrPool is freed.
-    m_DeviceAccess.reset();
+    m_pDeviceAccess.reset();
 
     /*
      * DefaultFormats and DefaultFormatCollections (FmtColl)
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 1cda015..3979d0d 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1915,7 +1915,7 @@ SwOLENodes* SwCntntNode::CreateOLENodesArray( const SwFmtColl& rColl, bool bOnly
  * Document Interface Access
  */
 const IDocumentSettingAccess* SwNode::getIDocumentSettingAccess() const { return GetDoc(); }
-const IDocumentDeviceAccess* SwNode::getIDocumentDeviceAccess() const { return GetDoc()->getIDocumentDeviceAccessConst(); }
+const IDocumentDeviceAccess* SwNode::getIDocumentDeviceAccess() const { return &GetDoc()->getIDocumentDeviceAccess(); }
 const IDocumentRedlineAccess* SwNode::getIDocumentRedlineAccess() const { return GetDoc(); }
 const IDocumentStylePoolAccess* SwNode::getIDocumentStylePoolAccess() const { return GetDoc(); }
 const IDocumentLineNumberAccess* SwNode::getIDocumentLineNumberAccess() const { return GetDoc(); }
diff --git a/sw/source/core/uibase/app/docsh.cxx b/sw/source/core/uibase/app/docsh.cxx
index 2ec17e0..963fdf6 100644
--- a/sw/source/core/uibase/app/docsh.cxx
+++ b/sw/source/core/uibase/app/docsh.cxx
@@ -805,10 +805,10 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup,
     JobSetup *pOrig = 0;
     if ( !rSetup.GetPrinterName().isEmpty() && ASPECT_THUMBNAIL != nAspect )
     {
-        pOrig = const_cast<JobSetup*>(pDoc->getIDocumentDeviceAccessConst()->getJobsetup());
+        pOrig = const_cast<JobSetup*>(pDoc->getIDocumentDeviceAccess().getJobsetup());
         if( pOrig )         // then we copy that
             pOrig = new JobSetup( *pOrig );
-        pDoc->getIDocumentDeviceAccess()->setJobsetup( rSetup );
+        pDoc->getIDocumentDeviceAccess().setJobsetup( rSetup );
     }
 
     Rectangle aRect( nAspect == ASPECT_THUMBNAIL ?
@@ -825,7 +825,7 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup,
 
     if( pOrig )
     {
-        pDoc->getIDocumentDeviceAccess()->setJobsetup( *pOrig );
+        pDoc->getIDocumentDeviceAccess().setJobsetup( *pOrig );
         delete pOrig;
     }
     if ( bResetModified )
@@ -872,20 +872,20 @@ Rectangle SwDocShell::GetVisArea( sal_uInt16 nAspect ) const
 
 Printer *SwDocShell::GetDocumentPrinter()
 {
-    return pDoc->getIDocumentDeviceAccessConst()->getPrinter( false );
+    return pDoc->getIDocumentDeviceAccess().getPrinter( false );
 }
 
 OutputDevice* SwDocShell::GetDocumentRefDev()
 {
-    return pDoc->getIDocumentDeviceAccessConst()->getReferenceDevice( false );
+    return pDoc->getIDocumentDeviceAccess().getReferenceDevice( false );
 }
 
 void SwDocShell::OnDocumentPrinterChanged( Printer * pNewPrinter )
 {
     if ( pNewPrinter )
-        GetDoc()->getIDocumentDeviceAccess()->setJobsetup( pNewPrinter->GetJobSetup() );
+        GetDoc()->getIDocumentDeviceAccess().setJobsetup( pNewPrinter->GetJobSetup() );
     else
-        GetDoc()->getIDocumentDeviceAccess()->setPrinter( 0, true, true );
+        GetDoc()->getIDocumentDeviceAccess().setPrinter( 0, true, true );
 }
 
 sal_uLong SwDocShell::GetMiscStatus() const
diff --git a/sw/source/core/uibase/app/docsh2.cxx b/sw/source/core/uibase/app/docsh2.cxx
index 428ade2..e68de40 100644
--- a/sw/source/core/uibase/app/docsh2.cxx
+++ b/sw/source/core/uibase/app/docsh2.cxx
@@ -154,8 +154,8 @@ void SwDocShell::ToggleBrowserMode(bool bSet, SwView* _pView )
     if( pTempView )
     {
         pTempView->GetViewFrame()->GetBindings().Invalidate(FN_SHADOWCURSOR);
-        if( !GetDoc()->getIDocumentDeviceAccessConst()->getPrinter( false ) )
-            pTempView->SetPrinter( GetDoc()->getIDocumentDeviceAccessConst()->getPrinter( false ), SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP );
+        if( !GetDoc()->getIDocumentDeviceAccess().getPrinter( false ) )
+            pTempView->SetPrinter( GetDoc()->getIDocumentDeviceAccess().getPrinter( false ), SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP );
         GetDoc()->CheckDefaultPageFmt();
         SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, false);
         while (pTmpFrm)
@@ -631,7 +631,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
                 SfxPrinter* pSavePrinter = 0;
                 if( 0 != pSrcView)
                 {
-                    SfxPrinter* pTemp = GetDoc()->getIDocumentDeviceAccessConst()->getPrinter( false );
+                    SfxPrinter* pTemp = GetDoc()->getIDocumentDeviceAccess().getPrinter( false );
                     if(pTemp)
                         pSavePrinter = new SfxPrinter(*pTemp);
                     bSetModified = IsModified() || pSrcView->IsModified();
@@ -660,7 +660,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
                     GetDoc()->SetModified();
                 if(pSavePrinter)
                 {
-                    GetDoc()->getIDocumentDeviceAccess()->setPrinter( pSavePrinter, true, true);
+                    GetDoc()->getIDocumentDeviceAccess().setPrinter( pSavePrinter, true, true);
                     //pSavePrinter must not be deleted again
                 }
                 pViewFrm->GetBindings().SetState(SfxBoolItem(SID_SOURCEVIEW, nSlot == SID_VIEWSHELL2));
diff --git a/sw/source/core/uibase/app/docshini.cxx b/sw/source/core/uibase/app/docshini.cxx
index 65fad68..9a68b17 100644
--- a/sw/source/core/uibase/app/docshini.cxx
+++ b/sw/source/core/uibase/app/docshini.cxx
@@ -124,14 +124,14 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
         pDoc->set(IDocumentSettingAccess::KERN_ASIAN_PUNCTUATION,
                   !aAsian.IsKerningWesternTextOnly());
         pDoc->setCharacterCompressionType(static_cast<SwCharCompressType>(aAsian.GetCharDistanceCompression()));
-        pDoc->getIDocumentDeviceAccess()->setPrintData(*SW_MOD()->GetPrtOptions(bWeb));
+        pDoc->getIDocumentDeviceAccess().setPrintData(*SW_MOD()->GetPrtOptions(bWeb));
 
         SubInitNew();
 
         // for all
 
         SwStdFontConfig* pStdFont = SW_MOD()->GetStdFontConfig();
-        SfxPrinter* pPrt = pDoc->getIDocumentDeviceAccessConst()->getPrinter( false );
+        SfxPrinter* pPrt = pDoc->getIDocumentDeviceAccess().getPrinter( false );
 
         OUString sEntry;
         sal_uInt16 aFontWhich[] =
@@ -424,7 +424,7 @@ void SwDocShell::UpdateFontList()
         if( pDoc )
         {
             delete pFontList;
-            pFontList = new FontList( pDoc->getIDocumentDeviceAccessConst()->getReferenceDevice( true ) );
+            pFontList = new FontList( pDoc->getIDocumentDeviceAccess().getReferenceDevice( true ) );
             PutItem( SvxFontListItem( pFontList, SID_ATTR_CHAR_FONTLIST ) );
         }
         bInUpdateFontList = false;
@@ -678,7 +678,7 @@ void SwDocShell::SubInitNew()
 /*
  * Document Interface Access
  */
-IDocumentDeviceAccess* SwDocShell::getIDocumentDeviceAccess() { return pDoc->getIDocumentDeviceAccess(); }
+IDocumentDeviceAccess* SwDocShell::getIDocumentDeviceAccess() { return &pDoc->getIDocumentDeviceAccess(); }
 const IDocumentSettingAccess* SwDocShell::getIDocumentSettingAccess() const { return pDoc; }
 IDocumentChartDataProviderAccess* SwDocShell::getIDocumentChartDataProviderAccess() { return pDoc; }
 
diff --git a/sw/source/core/uibase/dialog/SwSpellDialogChildWindow.cxx b/sw/source/core/uibase/dialog/SwSpellDialogChildWindow.cxx
index 0a73faa..a7c5601 100644
--- a/sw/source/core/uibase/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/core/uibase/dialog/SwSpellDialogChildWindow.cxx
@@ -769,7 +769,7 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh)
                     SdrOutliner aTmpOutliner(pDoc->GetDrawModel()->
                                              GetDrawOutliner().GetEmptyItemSet().GetPool(),
                                                 OUTLINERMODE_TEXTOBJECT );
-                    aTmpOutliner.SetRefDevice( pDoc->getIDocumentDeviceAccessConst()->getPrinter( false ) );
+                    aTmpOutliner.SetRefDevice( pDoc->getIDocumentDeviceAccess().getPrinter( false ) );
                     MapMode aMapMode (MAP_TWIP);
                     aTmpOutliner.SetRefMapMode(aMapMode);
                     aTmpOutliner.SetPaperSize( pTextObj->GetLogicRect().GetSize() );
diff --git a/sw/source/core/uibase/lingu/sdrhhcwrap.cxx b/sw/source/core/uibase/lingu/sdrhhcwrap.cxx
index 137c902..92b3b56 100644
--- a/sw/source/core/uibase/lingu/sdrhhcwrap.cxx
+++ b/sw/source/core/uibase/lingu/sdrhhcwrap.cxx
@@ -62,7 +62,7 @@ SdrHHCWrapper::SdrHHCWrapper( SwView* pVw,
     pTargetFont( pTargetFnt ),
     bIsInteractive( bInteractive )
 {
-    SetRefDevice( pView->GetDocShell()->GetDoc()->getIDocumentDeviceAccessConst()->getPrinter( false ) );
+    SetRefDevice( pView->GetDocShell()->GetDoc()->getIDocumentDeviceAccess().getPrinter( false ) );
 
     MapMode aMapMode (MAP_TWIP);
     SetRefMapMode(aMapMode);
diff --git a/sw/source/core/uibase/misc/glshell.cxx b/sw/source/core/uibase/misc/glshell.cxx
index aaaa7c8..22a5884 100644
--- a/sw/source/core/uibase/misc/glshell.cxx
+++ b/sw/source/core/uibase/misc/glshell.cxx
@@ -237,7 +237,7 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const OUString& rGroup, const OUString
         xDocSh->GetDoc()->GetIDocumentUndoRedo().DoUndo( false );
 
         xDocSh->GetWrtShell()->InsertGlossary( *pGroup, rShortName );
-        if( !xDocSh->GetDoc()->getIDocumentDeviceAccessConst()->getPrinter( false ) )
+        if( !xDocSh->GetDoc()->getIDocumentDeviceAccess().getPrinter( false ) )
         {
             // we create a default SfxPrinter.
             // ItemSet is deleted by Sfx!
@@ -249,7 +249,7 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const OUString& rGroup, const OUString
             SfxPrinter* pPrinter = new SfxPrinter( pSet );
 
             // and append it to the document.
-            xDocSh->GetDoc()->getIDocumentDeviceAccess()->setPrinter( pPrinter, true, true );
+            xDocSh->GetDoc()->getIDocumentDeviceAccess().setPrinter( pPrinter, true, true );
         }
 
         xDocSh->SetTitle( aDocTitle );
diff --git a/sw/source/core/uibase/uiview/srcview.cxx b/sw/source/core/uibase/uiview/srcview.cxx
index 56d0b81..37ac826 100644
--- a/sw/source/core/uibase/uiview/srcview.cxx
+++ b/sw/source/core/uibase/uiview/srcview.cxx
@@ -664,7 +664,7 @@ sal_uInt16 SwSrcView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, bool )
     SwDocShell* pDocSh = GetDocShell();
     if ( (SFX_PRINTER_JOBSETUP | SFX_PRINTER_PRINTER) & nDiffFlags )
     {
-        pDocSh->GetDoc()->getIDocumentDeviceAccess()->setPrinter( pNew, true, true );
+        pDocSh->GetDoc()->getIDocumentDeviceAccess().setPrinter( pNew, true, true );
         if ( nDiffFlags & SFX_PRINTER_PRINTER )
             pDocSh->SetModified();
     }
@@ -682,7 +682,7 @@ sal_uInt16 SwSrcView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, bool )
 
 SfxPrinter* SwSrcView::GetPrinter( bool bCreate )
 {
-    return  GetDocShell()->GetDoc()->getIDocumentDeviceAccessConst()->getPrinter( bCreate );
+    return  GetDocShell()->GetDoc()->getIDocumentDeviceAccess().getPrinter( bCreate );
 }
 
 sal_Int32 SwSrcView::PrintSource(
diff --git a/sw/source/core/uibase/uno/SwXDocumentSettings.cxx b/sw/source/core/uibase/uno/SwXDocumentSettings.cxx
index 1c38014..6a472ab 100644
--- a/sw/source/core/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/core/uibase/uno/SwXDocumentSettings.cxx
@@ -378,7 +378,7 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
             {
                 if( !mpPrinter && !sPrinterName.isEmpty() && mpDocSh->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
                 {
-                    SfxPrinter* pPrinter = mpDoc->getIDocumentDeviceAccessConst()->getPrinter( true );
+                    SfxPrinter* pPrinter = mpDoc->getIDocumentDeviceAccess().getPrinter( true );
                     if ( OUString ( pPrinter->GetName()) != sPrinterName )
                     {
                         SfxPrinter *pNewPrinter = new SfxPrinter ( pPrinter->GetOptions().Clone(), sPrinterName );
@@ -518,7 +518,7 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
             else if ( nTmp != document::PrinterIndependentLayout::HIGH_RESOLUTION )
                 throw IllegalArgumentException();
 
-            mpDoc->getIDocumentDeviceAccess()->setReferenceDeviceType( bUseVirDev, bHiResVirDev );
+            mpDoc->getIDocumentDeviceAccess().setReferenceDeviceType( bUseVirDev, bHiResVirDev );
         }
         break;
         case HANDLE_IS_LABEL_DOC :
@@ -807,12 +807,12 @@ void SwXDocumentSettings::_postSetValues ()
         // #i86352# the printer is also used as container for options by sfx
         // when setting a printer it should have decent default options
         SfxItemSet aOptions( mpPrinter->GetOptions() );
-        SwPrintData aPrtData( mpDoc->getIDocumentDeviceAccessConst()->getPrintData() );
+        SwPrintData aPrtData( mpDoc->getIDocumentDeviceAccess().getPrintData() );
         SwAddPrinterItem aAddPrinterItem (FN_PARAM_ADDPRINTER, aPrtData);
         aOptions.Put(aAddPrinterItem);
         mpPrinter->SetOptions( aOptions );
 
-        mpDoc->getIDocumentDeviceAccess()->setPrinter( mpPrinter, true, true );
+        mpDoc->getIDocumentDeviceAccess().setPrinter( mpPrinter, true, true );
     }
 
     mpPrinter = 0;
@@ -881,13 +881,13 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
         break;
         case HANDLE_PRINTER_NAME:
         {
-            SfxPrinter *pPrinter = mpDoc->getIDocumentDeviceAccessConst()->getPrinter( false );
+            SfxPrinter *pPrinter = mpDoc->getIDocumentDeviceAccess().getPrinter( false );
             rValue <<= pPrinter ? OUString ( pPrinter->GetName()) : OUString();
         }
         break;
         case HANDLE_PRINTER_SETUP:
         {
-            SfxPrinter *pPrinter = mpDoc->getIDocumentDeviceAccessConst()->getPrinter( false );
+            SfxPrinter *pPrinter = mpDoc->getIDocumentDeviceAccess().getPrinter( false );
             if (pPrinter)
             {
                 SvMemoryStream aStream;
diff --git a/sw/source/core/uibase/uno/unomod.cxx b/sw/source/core/uibase/uno/unomod.cxx
index d110606..3585638 100644
--- a/sw/source/core/uibase/uno/unomod.cxx
+++ b/sw/source/core/uibase/uno/unomod.cxx
@@ -290,7 +290,7 @@ void SwXPrintSettings::_preSetValues ()
         {
             if (!mpDoc)
                 throw IllegalArgumentException ();
-            mpPrtOpt = const_cast< SwPrintData * >(&mpDoc->getIDocumentDeviceAccessConst()->getPrintData());
+            mpPrtOpt = const_cast< SwPrintData * >(&mpDoc->getIDocumentDeviceAccess().getPrintData());
         }
         break;
     }
@@ -447,7 +447,7 @@ void SwXPrintSettings::_preGetValues ()
         {
             if (!mpDoc)
                 throw IllegalArgumentException ();
-            mpPrtOpt = const_cast< SwPrintData * >(&mpDoc->getIDocumentDeviceAccessConst()->getPrintData());
+            mpPrtOpt = const_cast< SwPrintData * >(&mpDoc->getIDocumentDeviceAccess().getPrintData());
         }
         break;
     }
diff --git a/sw/source/core/uibase/uno/unotxdoc.cxx b/sw/source/core/uibase/uno/unotxdoc.cxx
index b5b5719..e6e6b0e 100644
--- a/sw/source/core/uibase/uno/unotxdoc.cxx
+++ b/sw/source/core/uibase/uno/unotxdoc.cxx
@@ -164,7 +164,7 @@ static SwPrintUIOptions * lcl_GetPrintUIOptions(
     const bool bHasPostIts      = sw_GetPostIts( pDocShell->GetDoc(), 0 );
 
     // get default values to use in dialog from documents SwPrintData
-    const SwPrintData &rPrintData = pDocShell->GetDoc()->getIDocumentDeviceAccessConst()->getPrintData();
+    const SwPrintData &rPrintData = pDocShell->GetDoc()->getIDocumentDeviceAccess().getPrintData();
 
     // Get current page number
     sal_uInt16 nCurrentPage = 1;
@@ -2448,7 +2448,7 @@ static void lcl_SavePrintUIOptionsToDocumentPrintData(
     const SwPrintUIOptions &rPrintUIOptions,
     bool bIsPDFEXport )
 {
-    SwPrintData aDocPrintData( rDoc.getIDocumentDeviceAccessConst()->getPrintData() );
+    SwPrintData aDocPrintData( rDoc.getIDocumentDeviceAccess().getPrintData() );
 
     aDocPrintData.SetPrintGraphic( rPrintUIOptions.IsPrintGraphics() );
     aDocPrintData.SetPrintTable( rPrintUIOptions.IsPrintTables() );
@@ -2469,7 +2469,7 @@ static void lcl_SavePrintUIOptionsToDocumentPrintData(
     aDocPrintData.SetPrintHiddenText( rPrintUIOptions.IsPrintHiddenText() );
     aDocPrintData.SetPrintTextPlaceholder( rPrintUIOptions.IsPrintTextPlaceholders() );
 
-    rDoc.getIDocumentDeviceAccess()->setPrintData( aDocPrintData );
+    rDoc.getIDocumentDeviceAccess().setPrintData( aDocPrintData );
 }
 
 sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
@@ -2845,7 +2845,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
             aRenderer[ nRenderDataIdxStart + 7 ].Name  = "NUpVerticalSpacing";
             aRenderer[ nRenderDataIdxStart + 7 ].Value <<= pPagePrintSettings->GetVertSpace();
             {
-                Printer* pPrinter = pDocShell->GetDoc()->getIDocumentDeviceAccessConst()->getPrinter( false );
+                Printer* pPrinter = pDocShell->GetDoc()->getIDocumentDeviceAccess().getPrinter( false );
                 if ( pPrinter )
                 {
                     awt::Size aNewPageSize;
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index af6f72b..b067fc5 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1788,7 +1788,7 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
         }
         case RES_PAPER_BIN:
         {
-            SfxPrinter *pPrinter = pDoc->getIDocumentDeviceAccessConst()->getPrinter( true );
+            SfxPrinter *pPrinter = pDoc->getIDocumentDeviceAccess().getPrinter( true );
             OUString sTmp;
             sal_uInt16 nBin = USHRT_MAX;
             if ( !( aValue >>= sTmp ) )
@@ -2346,7 +2346,7 @@ static uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
                     aRet <<= OUString( "[From printer settings]" );
                 else
                 {
-                    SfxPrinter *pPrinter = pDoc->getIDocumentDeviceAccessConst()->getPrinter( false );
+                    SfxPrinter *pPrinter = pDoc->getIDocumentDeviceAccess().getPrinter( false );
                     OUString sTmp;
                     if (pPrinter )
                         sTmp = pPrinter->GetPaperBinName ( nBin );
@@ -3046,10 +3046,10 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault(  )
                     SwFmtFrmSize aFrmSz( ATT_FIX_SIZE );
                     if( RES_POOLPAGE_STANDARD == rPageDesc.GetPoolFmtId() )
                     {
-                        if( m_pDoc->getIDocumentDeviceAccessConst()->getPrinter( false ) )
+                        if( m_pDoc->getIDocumentDeviceAccess().getPrinter( false ) )
                         {
                             const Size aPhysSize( SvxPaperInfo::GetPaperSize(
-                                        static_cast<Printer*>( m_pDoc->getIDocumentDeviceAccessConst()->getPrinter( false ) )) );
+                                        static_cast<Printer*>( m_pDoc->getIDocumentDeviceAccess().getPrinter( false ) )) );
                             aFrmSz.SetSize( aPhysSize );
                         }
                         else
diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx
index 8de3830..75334f6 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
@@ -66,7 +66,7 @@ void SwRenderData::DeletePostItData()
     if (HasPostItData())
     {
         // printer needs to remain at the real document
-        m_pPostItShell->GetDoc()->getIDocumentDeviceAccess()->setPrinter( 0, false, false );
+        m_pPostItShell->GetDoc()->getIDocumentDeviceAccess().setPrinter( 0, false, false );
         m_pPostItShell.reset();
         m_pPostItFields.reset();
     }
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 78f6fc4..cda9d3b 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1999,7 +1999,7 @@ OutputDevice& SwViewShell::GetRefDev() const
     else if ( 0 != mpTmpRef )
         pTmpOut = mpTmpRef;
     else
-        pTmpOut = GetDoc()->getIDocumentDeviceAccessConst()->getReferenceDevice( true );
+        pTmpOut = GetDoc()->getIDocumentDeviceAccess().getReferenceDevice( true );
 
     return *pTmpOut;
 }
@@ -2508,8 +2508,8 @@ SwPostItMgr* SwViewShell::GetPostItMgr()
  */
 const IDocumentSettingAccess* SwViewShell::getIDocumentSettingAccess() const { return mpDoc; }
 IDocumentSettingAccess* SwViewShell::getIDocumentSettingAccess() { return mpDoc; }
-const IDocumentDeviceAccess* SwViewShell::getIDocumentDeviceAccess() const { return mpDoc->getIDocumentDeviceAccessConst(); }
-IDocumentDeviceAccess* SwViewShell::getIDocumentDeviceAccess() { return mpDoc->getIDocumentDeviceAccess(); }
+const IDocumentDeviceAccess* SwViewShell::getIDocumentDeviceAccess() const { return &mpDoc->getIDocumentDeviceAccess(); }
+IDocumentDeviceAccess* SwViewShell::getIDocumentDeviceAccess() { return &mpDoc->getIDocumentDeviceAccess(); }
 const IDocumentMarkAccess* SwViewShell::getIDocumentMarkAccess() const { return mpDoc->getIDocumentMarkAccess(); }
 IDocumentMarkAccess* SwViewShell::getIDocumentMarkAccess() { return mpDoc->getIDocumentMarkAccess(); }
 const IDocumentDrawModelAccess* SwViewShell::getIDocumentDrawModelAccess() const { return mpDoc; }
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 26b7b35..de00eb4 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -150,7 +150,7 @@ SwViewShell::SwViewShell( SwDoc& rDocument, Window *pWindow,
     mpWin( pWindow ),
     mpOut( pOutput ? pOutput
                   : pWindow ? (OutputDevice*)pWindow
-                            : (OutputDevice*)rDocument.getIDocumentDeviceAccessConst()->getPrinter( true )),
+                            : (OutputDevice*)rDocument.getIDocumentDeviceAccess().getPrinter( true )),
     mpTmpRef( 0 ),
     mpOpt( 0 ),
     mpAccOptions( new SwAccessibilityOptions ),
@@ -226,7 +226,7 @@ SwViewShell::SwViewShell( SwViewShell& rShell, Window *pWindow,
     mpWin( pWindow ),
     mpOut( pOutput ? pOutput
                   : pWindow ? (OutputDevice*)pWindow
-                            : (OutputDevice*)rShell.GetDoc()->getIDocumentDeviceAccessConst()->getPrinter( true )),
+                            : (OutputDevice*)rShell.GetDoc()->getIDocumentDeviceAccess().getPrinter( true )),
     mpTmpRef( 0 ),
     mpOpt( 0 ),
     mpAccOptions( new SwAccessibilityOptions ),
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index c74421d..b91e15a 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -327,7 +327,7 @@ SwDoc * SwViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt)
     //! Make a copy of it since it gets destroyed with the temporary document
     //! used for PDF export
     if (pPrt)
-        pPrtDoc->getIDocumentDeviceAccess()->setPrinter( new SfxPrinter(*pPrt), true, true );
+        pPrtDoc->getIDocumentDeviceAccess().setPrinter( new SfxPrinter(*pPrt), true, true );
 
     const SfxPoolItem* pCpyItem;
     const SfxItemPool& rPool = GetAttrPool();
diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx
index 8167e6c..c670519 100644
--- a/sw/source/filter/ascii/parasc.cxx
+++ b/sw/source/filter/ascii/parasc.cxx
@@ -112,8 +112,8 @@ SwASCIIParser::SwASCIIParser(SwDoc* pD, const SwPaM& rCrsr, SvStream& rIn,
     if( !rOpt.GetFontName().isEmpty() )
     {
         Font aTextFont( rOpt.GetFontName(), Size( 0, 10 ) );
-        if( pDoc->getIDocumentDeviceAccessConst()->getPrinter( false ) )
-            aTextFont = pDoc->getIDocumentDeviceAccessConst()->getPrinter( false )->GetFontMetric( aTextFont );
+        if( pDoc->getIDocumentDeviceAccess().getPrinter( false ) )
+            aTextFont = pDoc->getIDocumentDeviceAccess().getPrinter( false )->GetFontMetric( aTextFont );
         SvxFontItem aFont( aTextFont.GetFamily(), aTextFont.GetName(),
                            OUString(), aTextFont.GetPitch(), aTextFont.GetCharSet(), RES_CHRATR_FONT );
         pItemSet->Put( aFont );
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx
index 4a3edc9..fe70db6 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -558,7 +558,7 @@ void Reader::MakeHTMLDummyTemplateDoc()
     pTemplate = new SwDoc;
     pTemplate->acquire();
     pTemplate->set(IDocumentSettingAccess::BROWSE_MODE, bTmplBrowseMode );
-    pTemplate->getIDocumentDeviceAccessConst()->getPrinter( true );
+    pTemplate->getIDocumentDeviceAccess().getPrinter( true );
     pTemplate->RemoveAllFmtLanguageDependencies();
     aChkDateTime = Date( 1, 1, 2300 );  // year 2300 should be sufficient
     aTemplateNm = "$$Dummy$$";
@@ -818,7 +818,7 @@ sal_uLong SwWriter::Write( WriterRef& rxWriter, const OUString* pRealFileName )
     // (e.g. if no printer was set) then set it to DIN A4.
     // #i37248# - Modifications are only allowed at a new document.
     // <pOutDoc> contains a new document, if <pDoc> is set - see above.
-    if ( pDoc && !pOutDoc->getIDocumentDeviceAccessConst()->getPrinter( false ) )
+    if ( pDoc && !pOutDoc->getIDocumentDeviceAccess().getPrinter( false ) )
     {
         const SwPageDesc& rPgDsc = pOutDoc->GetPageDesc( 0 );
         //const SwPageDesc& rPgDsc = *pOutDoc->GetPageDescFromPool( RES_POOLPAGE_STANDARD );
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 0820103..49632ab 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1401,7 +1401,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
         xProps->setPropertyValue("TabOverMargin", makeAny( false ) );
 
     SwDoc *pDoc = getDoc();
-    SfxPrinter *pPrinter = pDoc->getIDocumentDeviceAccessConst()->getPrinter( false );
+    SfxPrinter *pPrinter = pDoc->getIDocumentDeviceAccess().getPrinter( false );
     if( pPrinter )
     {
         // If the printer is known, then the OLE objects will
diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx
index 325e7ba..576497b 100644
--- a/sw/source/ui/dialog/ascfldlg.cxx
+++ b/sw/source/ui/dialog/ascfldlg.cxx
@@ -173,7 +173,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh,
 
         {
             bool bDelPrinter = false;
-            SfxPrinter* pPrt = pDoc ? pDoc->getIDocumentDeviceAccessConst()->getPrinter(false) : 0;
+            SfxPrinter* pPrt = pDoc ? pDoc->getIDocumentDeviceAccess().getPrinter(false) : 0;
             if( !pPrt )
             {
                 SfxItemSet* pSet = new SfxItemSet( rDocSh.GetPool(),


More information about the Libreoffice-commits mailing list