diff --git a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx index 19460512e4e9..63d093fdd563 100644 --- a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx +++ b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx @@ -98,7 +98,7 @@ OutputDevice * lcl_GetParentRefDevice( const uno::Reference< frame::XModel > & x DrawViewWrapper::DrawViewWrapper( SdrModel* pSdrModel, OutputDevice* pOut, bool bPaintPageForEditMode) : E3dView(pSdrModel, pOut) , m_pMarkHandleProvider(NULL) - , m_apOutliner( SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, pSdrModel ) ) + , m_apOutliner(SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, *pSdrModel)) , m_bRestoreMapMode( false ) { SetBufferedOutputAllowed(true); diff --git a/include/svx/svdetc.hxx b/include/svx/svdetc.hxx index e524364ed080..c3e451070316 100644 --- a/include/svx/svdetc.hxx +++ b/include/svx/svdetc.hxx @@ -49,7 +49,7 @@ namespace com { namespace sun { namespace star { namespace lang { // Ist pMod<>NULL, dann wird der MapMode des uebergebenen // Models verwendet. Die resultierende Default-Fonthoehe bleibt // jedoch dieselbe (die logische Fonthoehe wird umgerechnet). -SVX_DLLPUBLIC SdrOutliner* SdrMakeOutliner( sal_uInt16 nOutlinerMode, SdrModel* pMod ); +SVX_DLLPUBLIC SdrOutliner* SdrMakeOutliner(sal_uInt16 nOutlinerMode, SdrModel& rMod); // Globale Defaulteinstellungen fuer die DrawingEngine. // Diese Einstellungen sollte man direkt beim Applikationsstart @@ -100,7 +100,7 @@ public: // Ist pMod<>NULL, dann wird der MapMode des uebergebenen // Models verwendet. Die resultierende Default-Fonthoehe bleibt // jedoch dieselbe (die logische Fonthoehe wird umgerechnet). - friend SVX_DLLPUBLIC SdrOutliner* SdrMakeOutliner( sal_uInt16 nOutlinerMode, SdrModel* pMod ); + friend SVX_DLLPUBLIC SdrOutliner* SdrMakeOutliner(sal_uInt16 nOutlinerMode, SdrModel& rMod); }; class SfxItemSet; diff --git a/sc/source/ui/drawfunc/futext2.cxx b/sc/source/ui/drawfunc/futext2.cxx index 4e0e9368e43e..124c770f9c98 100644 --- a/sc/source/ui/drawfunc/futext2.cxx +++ b/sc/source/ui/drawfunc/futext2.cxx @@ -27,7 +27,7 @@ SdrOutliner* FuText::MakeOutliner() { ScViewData& rViewData = pViewShell->GetViewData(); - SdrOutliner* pOutl = SdrMakeOutliner(OUTLINERMODE_OUTLINEOBJECT, pDrDoc); + SdrOutliner* pOutl = SdrMakeOutliner(OUTLINERMODE_OUTLINEOBJECT, *pDrDoc); rViewData.UpdateOutlinerFlags(*pOutl); diff --git a/sd/source/ui/func/fuexpand.cxx b/sd/source/ui/func/fuexpand.cxx index dc349d837c6a..5d58d83d875a 100644 --- a/sd/source/ui/func/fuexpand.cxx +++ b/sd/source/ui/func/fuexpand.cxx @@ -190,7 +190,7 @@ void FuExpandPage::DoExecute( SfxRequest& ) if( pOutlinerParaObject->GetDepth(0) != -1 ) { - SdrOutliner* pTempOutl = SdrMakeOutliner( OUTLINERMODE_TITLEOBJECT, mpDoc ); + SdrOutliner* pTempOutl = SdrMakeOutliner(OUTLINERMODE_TITLEOBJECT, *mpDoc); pTempOutl->SetText( *pOutlinerParaObject ); @@ -218,7 +218,7 @@ void FuExpandPage::DoExecute( SfxRequest& ) // create structuring text objects OutlinerParaObject* pOPO = pOutl->CreateParaObject(++nParaPos, nChildCount); - SdrOutliner* pTempOutl = SdrMakeOutliner( OUTLINERMODE_OUTLINEOBJECT, mpDoc ); + SdrOutliner* pTempOutl = SdrMakeOutliner(OUTLINERMODE_OUTLINEOBJECT, *mpDoc); pTempOutl->SetText( *pOPO ); sal_Int32 nParaCount2 = pTempOutl->GetParagraphCount(); diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index d4aa31ac756a..be1ac08a9812 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -1038,7 +1038,7 @@ void FuText::SetInEditMode(const MouseEvent& rMEvt, bool bQuickDrag) nSdrObjKind == OBJ_OUTLINETEXT || !mxTextObj->IsEmptyPresObj() ) ) { // create new outliner (owned by SdrObjEditView) - SdrOutliner* pOutl = SdrMakeOutliner( OUTLINERMODE_OUTLINEOBJECT, mpDoc ); + SdrOutliner* pOutl = SdrMakeOutliner(OUTLINERMODE_OUTLINEOBJECT, *mpDoc); if (bEmptyOutliner) mpView->SdrEndTextEdit(true); diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 899506492db4..9f6d25b8dd14 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -672,7 +672,7 @@ bool View::SdrBeginTextEdit( sd::tools::EventMultiplexerEvent::EID_BEGIN_TEXT_EDIT, (void*)pObj ); if( pOutl==NULL && pObj ) - pOutl = SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, pObj->GetModel() ); + pOutl = SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, *pObj->GetModel()); // make draw&impress specific initialisations if( pOutl ) @@ -1258,7 +1258,7 @@ bool View::ShouldToggleOn( return false; bool bToggleOn = false; - boost::scoped_ptr pOutliner(SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, pSdrModel)); + boost::scoped_ptr pOutliner(SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, *pSdrModel)); const size_t nMarkCount = GetMarkedObjectCount(); for (size_t nIndex = 0; nIndex < nMarkCount && !bToggleOn; ++nIndex) { @@ -1330,7 +1330,7 @@ void View::ChangeMarkedObjectsBulletsNumbering( ? false : ShouldToggleOn( bToggle, bHandleBullets ); - boost::scoped_ptr pOutliner(SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, pSdrModel)); + boost::scoped_ptr pOutliner(SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, *pSdrModel)); boost::scoped_ptr pOutlinerView(new OutlinerView(pOutliner.get(), pWindow)); const size_t nMarkCount = GetMarkedObjectCount(); diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx index d28b38822e14..96552fd6aa0d 100644 --- a/svx/source/sdr/properties/textproperties.cxx +++ b/svx/source/sdr/properties/textproperties.cxx @@ -405,7 +405,7 @@ namespace sdr && !rObj.IsTextEditActive() && !rObj.IsLinkedText()) { - Outliner* pOutliner = SdrMakeOutliner(OUTLINERMODE_OUTLINEOBJECT, rObj.GetModel()); + Outliner* pOutliner = SdrMakeOutliner(OUTLINERMODE_OUTLINEOBJECT, *rObj.GetModel()); const svx::ITextProvider& rTextProvider(getTextProvider()); sal_Int32 nText = rTextProvider.getTextCount(); diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 00e51b058b44..4568e1696421 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -602,7 +602,7 @@ bool SdrObjEditView::SdrBeginTextEdit( mxTextEditObj.reset( pObj ); pTextEditOutliner=pGivenOutliner; if (pTextEditOutliner==NULL) - pTextEditOutliner = SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, mxTextEditObj->GetModel() ); + pTextEditOutliner = SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, *mxTextEditObj->GetModel() ); { SvtAccessibilityOptions aOptions; diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx index b9bdbf07e6b3..32eb75aebca3 100644 --- a/svx/source/svdraw/svdetc.cxx +++ b/svx/source/svdraw/svdetc.cxx @@ -386,8 +386,6 @@ bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol) return bRetval; } - - SdrEngineDefaults::SdrEngineDefaults(): aFontName( OutputDevice::GetDefaultFont( DEFAULTFONT_SERIF, LANGUAGE_SYSTEM, DEFAULTFONT_FLAGS_ONLYONE ).GetName() ), eFontFamily(FAMILY_ROMAN), @@ -407,26 +405,20 @@ SdrEngineDefaults& SdrEngineDefaults::GetDefaults() return *rGlobalData.pDefaults; } - - -SdrOutliner* SdrMakeOutliner( sal_uInt16 nOutlinerMode, SdrModel* pModel ) +SdrOutliner* SdrMakeOutliner(sal_uInt16 nOutlinerMode, SdrModel& rModel) { - SfxItemPool* pPool = &pModel->GetItemPool(); + SfxItemPool* pPool = &rModel.GetItemPool(); SdrOutliner* pOutl = new SdrOutliner( pPool, nOutlinerMode ); pOutl->SetEditTextObjectPool( pPool ); - pOutl->SetStyleSheetPool( static_cast( pModel->GetStyleSheetPool() ) ); - pOutl->SetDefTab( pModel->GetDefaultTabulator() ); - pOutl->SetForbiddenCharsTable( pModel->GetForbiddenCharsTable() ); - pOutl->SetAsianCompressionMode( pModel->GetCharCompressType() ); - pOutl->SetKernAsianPunctuation( pModel->IsKernAsianPunctuation() ); - pOutl->SetAddExtLeading( pModel->IsAddExtLeading() ); - + pOutl->SetStyleSheetPool( static_cast(rModel.GetStyleSheetPool())); + pOutl->SetDefTab(rModel.GetDefaultTabulator()); + pOutl->SetForbiddenCharsTable(rModel.GetForbiddenCharsTable()); + pOutl->SetAsianCompressionMode(rModel.GetCharCompressType()); + pOutl->SetKernAsianPunctuation(rModel.IsKernAsianPunctuation()); + pOutl->SetAddExtLeading(rModel.IsAddExtLeading()); return pOutl; } - - - SdrLinkList& ImpGetUserMakeObjHdl() { SdrGlobalData& rGlobalData=GetSdrGlobalData(); @@ -439,8 +431,6 @@ SdrLinkList& ImpGetUserMakeObjUserDataHdl() return rGlobalData.aUserMakeObjUserDataHdl; } - - ResMgr* ImpGetResMgr() { SdrGlobalData& rGlobalData = GetSdrGlobalData(); @@ -454,15 +444,11 @@ ResMgr* ImpGetResMgr() return rGlobalData.pResMgr; } - - OUString ImpGetResStr(sal_uInt16 nResID) { return ResId(nResID, *ImpGetResMgr()).toString(); } - - namespace sdr { OUString GetResourceString(sal_uInt16 nResID) @@ -471,8 +457,6 @@ namespace sdr } } - - bool SearchOutlinerItems(const SfxItemSet& rSet, bool bInklDefaults, bool* pbOnlyEE) { bool bHas=false; diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index f06d66700b63..a2974b117958 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -208,10 +208,10 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe // can't create DrawOutliner OnDemand, because I can't get the Pool, // then (only from 302 onwards!) - pDrawOutliner = SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, this ); + pDrawOutliner = SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, *this); ImpSetOutlinerDefaults(pDrawOutliner, true); - pHitTestOutliner = SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, this ); + pHitTestOutliner = SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, *this); ImpSetOutlinerDefaults(pHitTestOutliner, true); ImpCreateTables(); diff --git a/svx/source/svdraw/svdoutlinercache.cxx b/svx/source/svdraw/svdoutlinercache.cxx index c85266837534..3c733ef96ed7 100644 --- a/svx/source/svdraw/svdoutlinercache.cxx +++ b/svx/source/svdraw/svdoutlinercache.cxx @@ -45,7 +45,7 @@ SdrOutliner* SdrOutlinerCache::createOutliner( sal_uInt16 nOutlinerMode ) } else { - pOutliner = SdrMakeOutliner( nOutlinerMode, mpModel ); + pOutliner = SdrMakeOutliner(nOutlinerMode, *mpModel); Outliner& aDrawOutliner = mpModel->GetDrawOutliner(); pOutliner->SetCalcFieldValueHdl( aDrawOutliner.GetCalcFieldValueHdl() ); maActiveOutliners.push_back(pOutliner); diff --git a/svx/source/svdraw/svdtext.cxx b/svx/source/svdraw/svdtext.cxx index ed99ae31008f..5563bf333134 100644 --- a/svx/source/svdraw/svdtext.cxx +++ b/svx/source/svdraw/svdtext.cxx @@ -173,7 +173,7 @@ void SdrText::ForceOutlinerParaObject( sal_uInt16 nOutlMode ) { if( mpModel && !mpOutlinerParaObject ) { - boost::scoped_ptr pOutliner(SdrMakeOutliner( nOutlMode, mpModel )); + boost::scoped_ptr pOutliner(SdrMakeOutliner(nOutlMode, *mpModel)); if( pOutliner ) { Outliner& aDrawOutliner = mpModel->GetDrawOutliner(); diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 13699d485483..3ef0370b00ef 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -1825,11 +1825,11 @@ void SvxTableController::EditCell( const CellPos& rPos, vcl::Window* pWindow, co pTableObj->setActiveCell( aPos ); // create new outliner, owner will be the SdrObjEditView - SdrOutliner* pOutl = SdrMakeOutliner( OUTLINERMODE_OUTLINEOBJECT, mpModel ); - if( pTableObj->IsVerticalWriting() ) + SdrOutliner* pOutl = mpModel ? SdrMakeOutliner(OUTLINERMODE_OUTLINEOBJECT, *mpModel) : NULL; + if (pOutl && pTableObj->IsVerticalWriting()) pOutl->SetVertical( true ); - if(mpView->SdrBeginTextEdit(pTableObj, pPV, pWindow, true, pOutl)) + if (mpView->SdrBeginTextEdit(pTableObj, pPV, pWindow, true, pOutl)) { maCursorLastPos = maCursorFirstPos = rPos; diff --git a/svx/source/table/tablertfimporter.cxx b/svx/source/table/tablertfimporter.cxx index fe7bf94abb25..caf0570e2306 100644 --- a/svx/source/table/tablertfimporter.cxx +++ b/svx/source/table/tablertfimporter.cxx @@ -127,7 +127,7 @@ private: SdrTableRTFParser::SdrTableRTFParser( SdrTableObj& rTableObj ) : mrTableObj( rTableObj ) -, mpOutliner( SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, rTableObj.GetModel() ) ) +, mpOutliner( SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, *rTableObj.GetModel() ) ) , mrItemPool( rTableObj.GetModel()->GetItemPool() ) , mnLastToken( 0 ) , mbNewDef( false ) diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx index 52929b13c4c3..4e2bfe22d0c5 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -511,7 +511,7 @@ bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, vcl::Window* pWin, { SwWrtShell *pSh = &GetWrtShell(); SdrView *pSdrView = pSh->GetDrawView(); - SdrOutliner* pOutliner = ::SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, pSdrView->GetModel()); + SdrOutliner* pOutliner = ::SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, *pSdrView->GetModel()); uno::Reference< linguistic2::XSpellChecker1 > xSpell( ::GetSpellChecker() ); if (pOutliner) {