summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorValentin Kettner <vakevk+libreoffice@gmail.com>2014-05-21 17:39:52 +0200
committerValentin Kettner <vakevk+libreoffice@gmail.com>2014-06-03 19:12:01 +0200
commitdbb2e6befb9d0e970048dfb2c31c7cdc281c8ed5 (patch)
tree80f001baa32add41e9cc0027edf03e58061330b9 /sw/source/uibase
parent2ec2ec98bc61e1398494dcaea1b017423c57e721 (diff)
Made SwDoc::getDocumentDeviceAccess return a reference.
Also overloaded SwDoc::getDocumentDeviceAccess with its const version. Change-Id: I3272be3ee067aa2e0174663ede3c98190ecf2b09
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/app/docsh.cxx14
-rw-r--r--sw/source/uibase/app/docsh2.cxx8
-rw-r--r--sw/source/uibase/app/docshini.cxx8
-rw-r--r--sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx2
-rw-r--r--sw/source/uibase/lingu/sdrhhcwrap.cxx2
-rw-r--r--sw/source/uibase/misc/glshell.cxx4
-rw-r--r--sw/source/uibase/uiview/srcview.cxx4
-rw-r--r--sw/source/uibase/uno/SwXDocumentSettings.cxx12
-rw-r--r--sw/source/uibase/uno/unomod.cxx4
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx8
10 files changed, 33 insertions, 33 deletions
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;