diff options
author | Valentin Kettner <vakevk+libreoffice@gmail.com> | 2014-05-21 17:39:52 +0200 |
---|---|---|
committer | Valentin Kettner <vakevk+libreoffice@gmail.com> | 2014-06-03 19:12:01 +0200 |
commit | dbb2e6befb9d0e970048dfb2c31c7cdc281c8ed5 (patch) | |
tree | 80f001baa32add41e9cc0027edf03e58061330b9 | |
parent | 2ec2ec98bc61e1398494dcaea1b017423c57e721 (diff) |
Made SwDoc::getDocumentDeviceAccess return a reference.
Also overloaded SwDoc::getDocumentDeviceAccess with its const
version.
Change-Id: I3272be3ee067aa2e0174663ede3c98190ecf2b09
24 files changed, 61 insertions, 61 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 7add4209face..1aae4fde6d21 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 3e01688afedc..e9f2d3a5acee 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 c3e7ee6f76af..8b7e1ba72b91 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 d42dd9f39ee3..94bd30eb65c4 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 a99dafdb26a4..34d92501dbae 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -1913,7 +1913,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/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 2fff75125955..4c2e13939944 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1785,7 +1785,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 ) ) @@ -2343,7 +2343,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 ); @@ -3042,10 +3042,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 ff401a52d798..932573674e0f 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -64,7 +64,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 f5d2e0c810cb..cc34a43400b0 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 26b7b3565131..de00eb4a6065 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 c74421d80bbf..b91e15a6c017 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 8167e6cb35a1..c67051962d13 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 4a3edc93d332..fe70db6a1d53 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 08201038160a..49632abb5501 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 325e7bacfe2a..576497b211ca 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(), diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index 3b236453d5cb..e3ceb11f1044 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -804,10 +804,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 ? @@ -824,7 +824,7 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup, if( pOrig ) { - pDoc->getIDocumentDeviceAccess()->setJobsetup( *pOrig ); + pDoc->getIDocumentDeviceAccess().setJobsetup( *pOrig ); delete pOrig; } if ( bResetModified ) @@ -871,20 +871,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/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 428ade2ebaef..e68de4052b3e 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/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/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx index 759adf389df7..82026d628ae4 100644 --- a/sw/source/uibase/app/docshini.cxx +++ b/sw/source/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[] = @@ -423,7 +423,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; @@ -676,7 +676,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/uibase/dialog/SwSpellDialogChildWindow.cxx b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx index 0a73faa78a5e..a7c5601b6750 100644 --- a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx +++ b/sw/source/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/uibase/lingu/sdrhhcwrap.cxx b/sw/source/uibase/lingu/sdrhhcwrap.cxx index 137c90216fb8..92b3b562a724 100644 --- a/sw/source/uibase/lingu/sdrhhcwrap.cxx +++ b/sw/source/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/uibase/misc/glshell.cxx b/sw/source/uibase/misc/glshell.cxx index aaaa7c8bc7d5..22a5884908a2 100644 --- a/sw/source/uibase/misc/glshell.cxx +++ b/sw/source/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/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx index 904767792f70..4e9fe9ae597c 100644 --- a/sw/source/uibase/uiview/srcview.cxx +++ b/sw/source/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/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx index d34154d1e908..c3763ee1d48c 100644 --- a/sw/source/uibase/uno/SwXDocumentSettings.cxx +++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx @@ -380,7 +380,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 ); @@ -520,7 +520,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 : @@ -816,12 +816,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; @@ -891,13 +891,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/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx index b0cfa31bacab..986145f3dfe1 100644 --- a/sw/source/uibase/uno/unomod.cxx +++ b/sw/source/uibase/uno/unomod.cxx @@ -292,7 +292,7 @@ void SwXPrintSettings::_preSetValues () { if (!mpDoc) throw IllegalArgumentException (); - mpPrtOpt = const_cast< SwPrintData * >(&mpDoc->getIDocumentDeviceAccessConst()->getPrintData()); + mpPrtOpt = const_cast< SwPrintData * >(&mpDoc->getIDocumentDeviceAccess().getPrintData()); } break; } @@ -451,7 +451,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/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index e8478824ee90..ea708ecd0372 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/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; |