summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sfx2/objsh.hxx9
-rw-r--r--sfx2/source/doc/objstor.cxx4
-rw-r--r--sw/inc/docsh.hxx34
-rw-r--r--sw/source/uibase/app/docsh.cxx276
-rw-r--r--sw/source/uibase/app/docsh2.cxx132
-rw-r--r--sw/source/uibase/app/docshdrw.cxx2
-rw-r--r--sw/source/uibase/app/docshini.cxx192
-rw-r--r--sw/source/uibase/app/docst.cxx64
8 files changed, 371 insertions, 342 deletions
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 1cb8e910af05..6ca8ddb82355 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -177,6 +177,15 @@ private:
// sal_False := new object
bool bIsInGenerateThumbnail; //optimize thumbnail generate and store procedure to improve odt saving performance, i120030
+
+protected:
+ // methods called in implementation of <ImportFrom(..)>
+ virtual void BeforeLoading(SfxMedium&,
+ const OUString&) {}
+
+ virtual void AfterLoading(SfxMedium&,
+ const OUString&) {}
+
private:
SAL_DLLPRIVATE void UpdateTime_Impl(const ::com::sun::star::uno::Reference<
::com::sun::star::document::XDocumentProperties> & i_xDocProps);
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 1e37373efdd7..b971c93c8930 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2177,6 +2177,8 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
{
OUString aFilterName( rMedium.GetFilter()->GetFilterName() );
+ BeforeLoading(rMedium, aFilterName);
+
uno::Reference< lang::XMultiServiceFactory > xMan = ::comphelper::getProcessServiceFactory();
uno::Reference < lang::XMultiServiceFactory > xFilterFact (
xMan->createInstance( "com.sun.star.document.FilterFactory" ), uno::UNO_QUERY );
@@ -2284,6 +2286,8 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
}
}
}
+ AfterLoading(rMedium, aFilterName);
+
return bRtn;
}
catch (const packages::zip::ZipIOException&)
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index 9760272e43ea..230b267d0391 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -54,24 +54,24 @@ class IDocumentChartDataProviderAccess;
class SW_DLLPUBLIC SwDocShell: public SfxObjectShell, public SfxListener
{
- SwDoc* pDoc; ///< Document.
+ SwDoc* mpDoc; ///< Document.
rtl::Reference< SfxStyleSheetBasePool > mxBasePool; ///< Passing through for formats.
- FontList* pFontList; ///< Current Fontlist.
+ FontList* mpFontList; ///< Current Fontlist.
+ bool mbInUpdateFontList; ///< prevent nested calls of UpdateFontList
/** For "historical reasons" nothing can be done without the WrtShell.
Back-pointer on View (again "for historical reasons").
Back-pointer is valid until in Activate a new one is set
or until it is deleted in the View's Dtor. */
- SwView* pView;
- SwWrtShell* pWrtShell;
+ SwView* mpView;
+ SwWrtShell* mpWrtShell;
Timer aFinishedTimer; /**< Timer for checking graphics-links.
If all are present, the doc is loaded completely. */
- comphelper::EmbeddedObjectContainer* pOLEChildList;
- sal_Int16 nUpdateDocMode; ///< contains the com::sun::star::document::UpdateDocMode
- bool bInUpdateFontList; ///< prevent nested calls of UpdateFontList
+ comphelper::EmbeddedObjectContainer* mpOLEChildList;
+ sal_Int16 mnUpdateDocMode; ///< contains the com::sun::star::document::UpdateDocMode
bool bIsATemplate; ///< prevent nested calls of UpdateFontList
/// Methods for access to doc.
@@ -143,6 +143,12 @@ protected:
/// override to update text fields
virtual void DoFlushDocInfo() SAL_OVERRIDE;
+ // override <SfxObjectShell>'s method which is called in
+ // <SfxObjectShell::ImportFrom(..)>.
+ // <SfxObjectShell::ImportFrom(..)> is used by current import of Microsoft
+ // Word documents in OOXML file format.
+ virtual void BeforeLoading(SfxMedium&, const ::rtl::OUString&) SAL_OVERRIDE;
+
public:
using SotObject::GetInterface;
@@ -190,8 +196,8 @@ public:
void StateStyleSheet(SfxItemSet&, SwWrtShell* pSh = 0 );
/// returns Doc. But be careful!
- inline SwDoc* GetDoc() { return pDoc; }
- inline const SwDoc* GetDoc() const { return pDoc; }
+ inline SwDoc* GetDoc() { return mpDoc; }
+ inline const SwDoc* GetDoc() const { return mpDoc; }
IDocumentDeviceAccess* getIDocumentDeviceAccess();
const IDocumentSettingAccess* getIDocumentSettingAccess() const;
IDocumentChartDataProviderAccess* getIDocumentChartDataProviderAccess();
@@ -207,12 +213,12 @@ public:
/// Set View for actions via Shell.
void SetView(SwView* pVw);
- const SwView *GetView() const { return pView; }
- SwView *GetView() { return pView; }
+ const SwView *GetView() const { return mpView; }
+ SwView *GetView() { return mpView; }
/// Accress to the SwWrtShell belonging to SwView.
- SwWrtShell *GetWrtShell() { return pWrtShell; }
- const SwWrtShell *GetWrtShell() const { return pWrtShell; }
+ SwWrtShell *GetWrtShell() { return mpWrtShell; }
+ const SwWrtShell *GetWrtShell() const { return mpWrtShell; }
/// For Core - it knows the DocShell but not the WrtShell!
SwFEShell *GetFEShell();
@@ -263,7 +269,7 @@ public:
/// Re-read Doc from Html-source.
void ReloadFromHtml( const OUString& rStreamName, SwSrcView* pSrcView );
- sal_Int16 GetUpdateDocMode() const {return nUpdateDocMode;}
+ sal_Int16 GetUpdateDocMode() const {return mnUpdateDocMode;}
void ToggleBrowserMode(bool bOn, SwView* pView);
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index 8e8b30e62ff9..23816813ab64 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -176,7 +176,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr,
*ppRdr = pPaM ? new SwReader( rMedium, aFileName, *pPaM ) :
pCrsrShell ?
new SwReader( rMedium, aFileName, *pCrsrShell->GetCrsr() )
- : new SwReader( rMedium, aFileName, pDoc );
+ : new SwReader( rMedium, aFileName, mpDoc );
}
else
return 0;
@@ -210,7 +210,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr,
// #i30171# set the UpdateDocMode at the SwDocShell
SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, false);
- nUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE;
+ mnUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE;
if (!pFlt->GetDefaultTemplate().isEmpty())
pRead->SetTemplateName( pFlt->GetDefaultTemplate() );
@@ -241,7 +241,7 @@ bool SwDocShell::ConvertFrom( SfxMedium& rMedium )
return false; // #129881# return if no reader is found
SotStorageRef pStg=pRead->getSotStorageRef(); // #i45333# save sot storage ref in case of recursive calls
- pDoc->setDocAccTitle(OUString());
+ mpDoc->setDocAccTitle(OUString());
SfxViewFrame* pFrame1 = SfxViewFrame::GetFirst( this );
if (pFrame1)
{
@@ -263,21 +263,21 @@ bool SwDocShell::ConvertFrom( SfxMedium& rMedium )
pRdr->GetDoc()->getIDocumentSettingAccess().set(IDocumentSettingAccess::HTML_MODE, ISA(SwWebDocShell));
- /* #106748# Restore the pool default if reading a saved document. */
- pDoc->RemoveAllFmtLanguageDependencies();
+ // Restore the pool default if reading a saved document.
+ mpDoc->RemoveAllFmtLanguageDependencies();
sal_uLong nErr = pRdr->Read( *pRead );
// Maybe put away one old Doc
- if ( pDoc != pRdr->GetDoc() )
+ if ( mpDoc != pRdr->GetDoc() )
{
RemoveLink();
- pDoc = pRdr->GetDoc();
+ mpDoc = pRdr->GetDoc();
AddLink();
if ( !mxBasePool.is() )
- mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
+ mxBasePool = new SwDocStyleSheetPool( *mpDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
}
UpdateFontList();
@@ -290,7 +290,7 @@ bool SwDocShell::ConvertFrom( SfxMedium& rMedium )
SetError( nErr, OUString( OSL_LOG_PREFIX ) );
bool bOk = !IsError( nErr );
- if ( bOk && !pDoc->IsInLoadAsynchron() )
+ if ( bOk && !mpDoc->IsInLoadAsynchron() )
{
LoadingFinished();
}
@@ -300,22 +300,32 @@ bool SwDocShell::ConvertFrom( SfxMedium& rMedium )
return bOk;
}
+void SwDocShell::BeforeLoading(SfxMedium&, const ::rtl::OUString&)
+{
+ if (mpDoc == NULL)
+ {
+ return;
+ }
+
+ mpDoc->RemoveAllFmtLanguageDependencies();
+}
+
// Saving the Default-Format, Stg present
bool SwDocShell::Save()
{
//#i3370# remove quick help to prevent saving of autocorrection suggestions
- if(pView)
- pView->GetEditWin().StopQuickHelp();
+ if(mpView)
+ mpView->GetEditWin().StopQuickHelp();
SwWait aWait( *this, true );
CalcLayoutForOLEObjects(); // format for OLE objets
// #i62875#
// reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible
- if ( pWrtShell && pDoc &&
- pDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
- docfunc::AllDrawObjsOnPage( *pDoc ) )
+ if ( mpWrtShell && mpDoc &&
+ mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
+ docfunc::AllDrawObjsOnPage( *mpDoc ) )
{
- pDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
+ mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
}
sal_uLong nErr = ERR_SWG_WRITE_ERROR, nVBWarning = ERRCODE_NONE;
@@ -332,7 +342,7 @@ bool SwDocShell::Save()
WriterRef xWrt;
::GetXMLWriter( aEmptyOUStr, GetMedium()->GetBaseURL( true ), xWrt );
xWrt->SetOrganizerMode( true );
- SwWriter aWrt( *GetMedium(), *pDoc );
+ SwWriter aWrt( *GetMedium(), *mpDoc );
nErr = aWrt.Write( xWrt );
xWrt->SetOrganizerMode( false );
}
@@ -347,32 +357,32 @@ bool SwDocShell::Save()
case SFX_CREATE_MODE_PREVIEW:
default:
{
- if( pDoc->ContainsMSVBasic() )
+ if( mpDoc->ContainsMSVBasic() )
{
if( SvtFilterOptions::Get().IsLoadWordBasicStorage() )
nVBWarning = GetSaveWarningOfMSVBAStorage( (SfxObjectShell&) (*this) );
- pDoc->SetContainsMSVBasic( false );
+ mpDoc->SetContainsMSVBasic( false );
}
// End TableBox Edit!
- if( pWrtShell )
- pWrtShell->EndAllTblBoxEdit();
+ if( mpWrtShell )
+ mpWrtShell->EndAllTblBoxEdit();
WriterRef xWrt;
::GetXMLWriter( aEmptyOUStr, GetMedium()->GetBaseURL( true ), xWrt );
bool bLockedView(false);
- if ( pWrtShell )
+ if ( mpWrtShell )
{
- bLockedView = pWrtShell->IsViewLocked();
- pWrtShell->LockView( true ); //lock visible section
+ bLockedView = mpWrtShell->IsViewLocked();
+ mpWrtShell->LockView( true ); //lock visible section
}
- SwWriter aWrt( *GetMedium(), *pDoc );
+ SwWriter aWrt( *GetMedium(), *mpDoc );
nErr = aWrt.Write( xWrt );
- if ( pWrtShell )
- pWrtShell->LockView( bLockedView );
+ if ( mpWrtShell )
+ mpWrtShell->LockView( bLockedView );
}
break;
}
@@ -380,7 +390,7 @@ bool SwDocShell::Save()
}
SetError( nErr ? nErr : nVBWarning, OUString( OSL_LOG_PREFIX ) );
- SfxViewFrame* pFrm = pWrtShell ? pWrtShell->GetView().GetViewFrame() : 0;
+ SfxViewFrame* pFrm = mpWrtShell ? mpWrtShell->GetView().GetViewFrame() : 0;
if( pFrm )
{
pFrm->GetBindings().SetState(SfxBoolItem(SID_DOC_MODIFIED, false));
@@ -393,19 +403,19 @@ bool SwDocShell::SaveAs( SfxMedium& rMedium )
{
SwWait aWait( *this, true );
//#i3370# remove quick help to prevent saving of autocorrection suggestions
- if(pView)
- pView->GetEditWin().StopQuickHelp();
+ if(mpView)
+ mpView->GetEditWin().StopQuickHelp();
//#i91811# mod if we have an active margin window, write back the text
- if ( pView &&
- pView->GetPostItMgr() &&
- pView->GetPostItMgr()->HasActiveSidebarWin() )
+ if ( mpView &&
+ mpView->GetPostItMgr() &&
+ mpView->GetPostItMgr()->HasActiveSidebarWin() )
{
- pView->GetPostItMgr()->UpdateDataOnActiveSidebarWin();
+ mpView->GetPostItMgr()->UpdateDataOnActiveSidebarWin();
}
- if( pDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::GLOBAL_DOCUMENT) &&
- !pDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS) )
+ if( mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::GLOBAL_DOCUMENT) &&
+ !mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS) )
RemoveOLEObjects();
{
@@ -432,11 +442,11 @@ bool SwDocShell::SaveAs( SfxMedium& rMedium )
CalcLayoutForOLEObjects(); // format for OLE objets
// #i62875#
// reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible
- if ( pWrtShell &&
- pDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
- docfunc::AllDrawObjsOnPage( *pDoc ) )
+ if ( mpWrtShell &&
+ mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
+ docfunc::AllDrawObjsOnPage( *mpDoc ) )
{
- pDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
+ mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
}
sal_uLong nErr = ERR_SWG_WRITE_ERROR, nVBWarning = ERRCODE_NONE;
@@ -459,23 +469,23 @@ bool SwDocShell::SaveAs( SfxMedium& rMedium )
xDocSh->DoClose();
}
- if( pDoc->ContainsMSVBasic() )
+ if( mpDoc->ContainsMSVBasic() )
{
if( SvtFilterOptions::Get().IsLoadWordBasicStorage() )
nVBWarning = GetSaveWarningOfMSVBAStorage( (SfxObjectShell&) *this );
- pDoc->SetContainsMSVBasic( false );
+ mpDoc->SetContainsMSVBasic( false );
}
// End TableBox Edit!
- if( pWrtShell )
- pWrtShell->EndAllTblBoxEdit();
+ if( mpWrtShell )
+ mpWrtShell->EndAllTblBoxEdit();
// Remember and preserve Modified-Flag without calling the Link
// (for OLE; after Statement from MM)
- bool bIsModified = pDoc->IsModified();
- pDoc->GetIDocumentUndoRedo().LockUndoNoModifiedPosition();
- Link aOldOLELnk( pDoc->GetOle2Link() );
- pDoc->SetOle2Link( Link() );
+ bool bIsModified = mpDoc->IsModified();
+ mpDoc->GetIDocumentUndoRedo().LockUndoNoModifiedPosition();
+ Link aOldOLELnk( mpDoc->GetOle2Link() );
+ mpDoc->SetOle2Link( Link() );
// Suppress SfxProgress when we are Embedded
SW_MOD()->SetEmbeddedLoadSave(
@@ -485,29 +495,29 @@ bool SwDocShell::SaveAs( SfxMedium& rMedium )
::GetXMLWriter( aEmptyOUStr, rMedium.GetBaseURL( true ), xWrt );
bool bLockedView(false);
- if ( pWrtShell )
+ if ( mpWrtShell )
{
- bLockedView = pWrtShell->IsViewLocked();
- pWrtShell->LockView( true ); //lock visible section
+ bLockedView = mpWrtShell->IsViewLocked();
+ mpWrtShell->LockView( true ); //lock visible section
}
- SwWriter aWrt( rMedium, *pDoc );
+ SwWriter aWrt( rMedium, *mpDoc );
nErr = aWrt.Write( xWrt );
- if ( pWrtShell )
- pWrtShell->LockView( bLockedView );
+ if (mpWrtShell)
+ mpWrtShell->LockView( bLockedView );
if( bIsModified )
{
- pDoc->SetModified();
- pDoc->GetIDocumentUndoRedo().UnLockUndoNoModifiedPosition();
+ mpDoc->SetModified();
+ mpDoc->GetIDocumentUndoRedo().UnLockUndoNoModifiedPosition();
}
- pDoc->SetOle2Link( aOldOLELnk );
+ mpDoc->SetOle2Link( aOldOLELnk );
SW_MOD()->SetEmbeddedLoadSave( false );
// Increase RSID
- pDoc->setRsid( pDoc->getRsid() );
+ mpDoc->setRsid( mpDoc->getRsid() );
}
SetError( nErr ? nErr : nVBWarning, OUString( OSL_LOG_PREFIX ) );
@@ -539,20 +549,20 @@ bool SwDocShell::ConvertTo( SfxMedium& rMedium )
}
//#i3370# remove quick help to prevent saving of autocorrection suggestions
- if(pView)
- pView->GetEditWin().StopQuickHelp();
+ if(mpView)
+ mpView->GetEditWin().StopQuickHelp();
//#i91811# mod if we have an active margin window, write back the text
- if ( pView &&
- pView->GetPostItMgr() &&
- pView->GetPostItMgr()->HasActiveSidebarWin() )
+ if ( mpView &&
+ mpView->GetPostItMgr() &&
+ mpView->GetPostItMgr()->HasActiveSidebarWin() )
{
- pView->GetPostItMgr()->UpdateDataOnActiveSidebarWin();
+ mpView->GetPostItMgr()->UpdateDataOnActiveSidebarWin();
}
sal_uLong nVBWarning = 0;
- if( pDoc->ContainsMSVBasic() )
+ if( mpDoc->ContainsMSVBasic() )
{
bool bSave = pFlt->GetUserData() == "CWW8"
&& SvtFilterOptions::Get().IsLoadWordBasicStorage();
@@ -565,14 +575,14 @@ bool SwDocShell::ConvertTo( SfxMedium& rMedium )
{
nVBWarning = SaveOrDelMSVBAStorage( (SfxObjectShell&) *this, *xStg, bSave, OUString("Macros") );
xStg->Commit();
- pDoc->SetContainsMSVBasic( true );
+ mpDoc->SetContainsMSVBasic( true );
}
}
}
// End TableBox Edit!
- if( pWrtShell )
- pWrtShell->EndAllTblBoxEdit();
+ if( mpWrtShell )
+ mpWrtShell->EndAllTblBoxEdit();
if( pFlt->GetUserData() == "HTML" )
{
@@ -603,16 +613,16 @@ bool SwDocShell::ConvertTo( SfxMedium& rMedium )
}
// #i76360# Update document statistics
- pDoc->UpdateDocStat();
+ mpDoc->UpdateDocStat();
CalcLayoutForOLEObjects(); // format for OLE objets
// #i62875#
// reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible
- if ( pWrtShell &&
- pDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
- docfunc::AllDrawObjsOnPage( *pDoc ) )
+ if ( mpWrtShell &&
+ mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
+ docfunc::AllDrawObjsOnPage( *mpDoc ) )
{
- pDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
+ mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
}
if( xWriter->IsStgWriter() &&
@@ -684,7 +694,7 @@ bool SwDocShell::ConvertTo( SfxMedium& rMedium )
}
if( pFlt->GetUserData() == FILTER_TEXT_DLG &&
- ( pWrtShell || !::lcl_GetSourceView( this ) ))
+ ( mpWrtShell || !::lcl_GetSourceView( this ) ))
{
SwAsciiOptions aOpt;
OUString sItemOpt;
@@ -711,23 +721,23 @@ bool SwDocShell::ConvertTo( SfxMedium& rMedium )
const OUString aFileName( rMedium.GetName() );
// No View, so the whole Document!
- if ( pWrtShell && !Application::IsHeadlessModeEnabled() )
+ if ( mpWrtShell && !Application::IsHeadlessModeEnabled() )
{
SwWait aWait( *this, true );
// #i106906#
- const bool bFormerLockView = pWrtShell->IsViewLocked();
- pWrtShell->LockView( true );
- pWrtShell->StartAllAction();
- pWrtShell->Push();
- SwWriter aWrt( rMedium, *pWrtShell, true );
+ const bool bFormerLockView = mpWrtShell->IsViewLocked();
+ mpWrtShell->LockView( true );
+ mpWrtShell->StartAllAction();
+ mpWrtShell->Push();
+ SwWriter aWrt( rMedium, *mpWrtShell, true );
nErrno = aWrt.Write( xWriter, &aFileName );
//JP 16.05.97: In case the SFX revokes the View while saving
- if( pWrtShell )
+ if( mpWrtShell )
{
- pWrtShell->Pop(false);
- pWrtShell->EndAllAction();
+ mpWrtShell->Pop(false);
+ mpWrtShell->EndAllAction();
// #i106906#
- pWrtShell->LockView( bFormerLockView );
+ mpWrtShell->LockView( bFormerLockView );
}
}
else
@@ -741,7 +751,7 @@ bool SwDocShell::ConvertTo( SfxMedium& rMedium )
}
else
{
- SwWriter aWrt( rMedium, *pDoc );
+ SwWriter aWrt( rMedium, *mpDoc );
nErrno = aWrt.Write( xWriter, &aFileName );
}
}
@@ -763,27 +773,27 @@ bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xStor
{
// Do not decide until here, whether Saving was successful or not
if( IsModified() )
- pDoc->SetModified();
+ mpDoc->SetModified();
else
- pDoc->ResetModified();
+ mpDoc->ResetModified();
}
- if( pOLEChildList )
+ if (mpOLEChildList)
{
bool bResetModified = IsEnableSetModified();
if( bResetModified )
EnableSetModified( false );
- uno::Sequence < OUString > aNames = pOLEChildList->GetObjectNames();
+ uno::Sequence < OUString > aNames = mpOLEChildList->GetObjectNames();
for( sal_Int32 n = aNames.getLength(); n; n-- )
{
- if ( !pOLEChildList->MoveEmbeddedObject( aNames[n-1], GetEmbeddedObjectContainer() ) )
+ if ( !mpOLEChildList->MoveEmbeddedObject( aNames[n-1], GetEmbeddedObjectContainer() ) )
{
OSL_FAIL("Copying of objects didn't work!" );
}
}
- DELETEZ( pOLEChildList );
+ DELETEZ(mpOLEChildList);
if( bResetModified )
EnableSetModified( true );
}
@@ -806,10 +816,10 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup,
JobSetup *pOrig = 0;
if ( !rSetup.GetPrinterName().isEmpty() && ASPECT_THUMBNAIL != nAspect )
{
- pOrig = const_cast<JobSetup*>(pDoc->getIDocumentDeviceAccess().getJobsetup());
+ pOrig = const_cast<JobSetup*>(mpDoc->getIDocumentDeviceAccess().getJobsetup());
if( pOrig ) // then we copy that
pOrig = new JobSetup( *pOrig );
- pDoc->getIDocumentDeviceAccess().setJobsetup( rSetup );
+ mpDoc->getIDocumentDeviceAccess().setJobsetup( rSetup );
}
Rectangle aRect( nAspect == ASPECT_THUMBNAIL ?
@@ -821,12 +831,12 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup,
pDev->SetBackground();
const bool bWeb = this->ISA(SwWebDocShell);
SwPrintData aOpts;
- SwViewShell::PrtOle2( pDoc, SW_MOD()->GetUsrPref(bWeb), aOpts, pDev, aRect );
+ SwViewShell::PrtOle2( mpDoc, SW_MOD()->GetUsrPref(bWeb), aOpts, pDev, aRect );
pDev->Pop();
if( pOrig )
{
- pDoc->getIDocumentDeviceAccess().setJobsetup( *pOrig );
+ mpDoc->getIDocumentDeviceAccess().setJobsetup( *pOrig );
delete pOrig;
}
if ( bResetModified )
@@ -836,9 +846,9 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup,
void SwDocShell::SetVisArea( const Rectangle &rRect )
{
Rectangle aRect( rRect );
- if ( pView )
+ if (mpView)
{
- Size aSz( pView->GetDocSz() );
+ Size aSz( mpView->GetDocSz() );
aSz.Width() += DOCUMENTBORDER; aSz.Height() += DOCUMENTBORDER;
long nMoveX = 0, nMoveY = 0;
if ( aRect.Right() > aSz.Width() )
@@ -851,7 +861,7 @@ void SwDocShell::SetVisArea( const Rectangle &rRect )
aRect.Move( nMoveX, nMoveY );
// Calls SfxInPlaceObject::SetVisArea()!
- pView->SetVisArea( aRect, true );
+ mpView->SetVisArea( aRect, true );
}
else
SfxObjectShell::SetVisArea( aRect );
@@ -862,8 +872,8 @@ Rectangle SwDocShell::GetVisArea( sal_uInt16 nAspect ) const
if ( nAspect == ASPECT_THUMBNAIL )
{
// Preview: set VisArea to the first page.
- SwNodeIndex aIdx( pDoc->GetNodes().GetEndOfExtras(), 1 );
- SwCntntNode* pNd = pDoc->GetNodes().GoNext( &aIdx );
+ SwNodeIndex aIdx( mpDoc->GetNodes().GetEndOfExtras(), 1 );
+ SwCntntNode* pNd = mpDoc->GetNodes().GoNext( &aIdx );
const SwRect aPageRect = pNd->FindPageFrmRect( false, 0, false );
return aPageRect.SVRect();
@@ -873,12 +883,12 @@ Rectangle SwDocShell::GetVisArea( sal_uInt16 nAspect ) const
Printer *SwDocShell::GetDocumentPrinter()
{
- return pDoc->getIDocumentDeviceAccess().getPrinter( false );
+ return mpDoc->getIDocumentDeviceAccess().getPrinter( false );
}
OutputDevice* SwDocShell::GetDocumentRefDev()
{
- return pDoc->getIDocumentDeviceAccess().getReferenceDevice( false );
+ return mpDoc->getIDocumentDeviceAccess().getReferenceDevice( false );
}
void SwDocShell::OnDocumentPrinterChanged( Printer * pNewPrinter )
@@ -1021,7 +1031,7 @@ void SwDocShell::GetState(SfxItemSet& rSet)
case SID_ATTR_YEAR2000:
{
- const SvNumberFormatter* pFmtr = pDoc->GetNumberFormatter(false);
+ const SvNumberFormatter* pFmtr = mpDoc->GetNumberFormatter(false);
rSet.Put( SfxUInt16Item( nWhich,
static_cast< sal_uInt16 >(
pFmtr ? pFmtr->GetYear2000()
@@ -1030,14 +1040,14 @@ void SwDocShell::GetState(SfxItemSet& rSet)
break;
case SID_ATTR_CHAR_FONTLIST:
{
- rSet.Put( SvxFontListItem( pFontList, SID_ATTR_CHAR_FONTLIST ) );
+ rSet.Put( SvxFontListItem( mpFontList, SID_ATTR_CHAR_FONTLIST ) );
}
break;
case SID_MAIL_PREPAREEXPORT:
{
//check if linked content or possibly hidden content is available
- //pDoc->UpdateFlds( NULL, false );
- sfx2::LinkManager& rLnkMgr = pDoc->GetLinkManager();
+ //mpDoc->UpdateFlds( NULL, false );
+ sfx2::LinkManager& rLnkMgr = mpDoc->GetLinkManager();
const ::sfx2::SvBaseLinks& rLnks = rLnkMgr.GetLinks();
bool bRet = false;
if( !rLnks.empty() )
@@ -1045,7 +1055,7 @@ void SwDocShell::GetState(SfxItemSet& rSet)
else
{
//sections with hidden flag, hidden character attribute, hidden paragraph/text or conditional text fields
- bRet = pDoc->HasInvisibleContent();
+ bRet = mpDoc->HasInvisibleContent();
}
rSet.Put( SfxBoolItem( nWhich, bRet ) );
}
@@ -1078,15 +1088,15 @@ SfxStyleSheetBasePool* SwDocShell::GetStyleSheetPool()
void SwDocShell::SetView(SwView* pVw)
{
- if ( 0 != (pView = pVw) )
- pWrtShell = &pView->GetWrtShell();
+ if ( 0 != (mpView = pVw) )
+ mpWrtShell = &mpView->GetWrtShell();
else
- pWrtShell = 0;
+ mpWrtShell = 0;
}
void SwDocShell::PrepareReload()
{
- ::DelAllGrfCacheEntries( pDoc );
+ ::DelAllGrfCacheEntries( mpDoc );
}
// #i59688#
@@ -1102,7 +1112,7 @@ void SwDocShell::LoadingFinished()
// enables the document modification again.
// Thus, manuell modify the document, if its modified and its links are updated
// before <FinishedLoading(..)> is called.
- const bool bHasDocToStayModified( pDoc->IsModified() && pDoc->LinksUpdated() );
+ const bool bHasDocToStayModified( mpDoc->IsModified() && mpDoc->LinksUpdated() );
FinishedLoading( SFX_LOADED_ALL );
SfxViewFrame* pVFrame = SfxViewFrame::GetFirst(this);
@@ -1114,9 +1124,9 @@ void SwDocShell::LoadingFinished()
}
// #i38810#
- if ( bHasDocToStayModified && !pDoc->IsModified() )
+ if ( bHasDocToStayModified && !mpDoc->IsModified() )
{
- pDoc->SetModified();
+ mpDoc->SetModified();
}
}
@@ -1125,29 +1135,29 @@ void SwDocShell::CancelTransfers()
{
// Cancel all links from LinkManager
aFinishedTimer.Stop();
- pDoc->GetLinkManager().CancelTransfers();
+ mpDoc->GetLinkManager().CancelTransfers();
SfxObjectShell::CancelTransfers();
}
SwFEShell* SwDocShell::GetFEShell()
{
- return pWrtShell;
+ return mpWrtShell;
}
void SwDocShell::RemoveOLEObjects()
{
- SwIterator<SwCntntNode,SwFmtColl> aIter( *pDoc->GetDfltGrfFmtColl() );
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *mpDoc->GetDfltGrfFmtColl() );
for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
{
SwOLENode* pOLENd = pNd->GetOLENode();
if( pOLENd && ( pOLENd->IsOLEObjectDeleted() ||
pOLENd->IsInGlobalDocSection() ) )
{
- if( !pOLEChildList )
- pOLEChildList = new comphelper::EmbeddedObjectContainer;
+ if( !mpOLEChildList )
+ mpOLEChildList = new comphelper::EmbeddedObjectContainer;
OUString aObjName = pOLENd->GetOLEObj().GetCurrentPersistName();
- GetEmbeddedObjectContainer().MoveEmbeddedObject( aObjName, *pOLEChildList );
+ GetEmbeddedObjectContainer().MoveEmbeddedObject( aObjName, *mpOLEChildList );
}
}
}
@@ -1161,16 +1171,16 @@ void SwDocShell::RemoveOLEObjects()
// saved, but of course only id there are OLE objects with bOLESizeInvalid set.
void SwDocShell::CalcLayoutForOLEObjects()
{
- if( !pWrtShell )
+ if( !mpWrtShell )
return;
- SwIterator<SwCntntNode,SwFmtColl> aIter( *pDoc->GetDfltGrfFmtColl() );
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *mpDoc->GetDfltGrfFmtColl() );
for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
{
SwOLENode* pOLENd = pNd->GetOLENode();
if( pOLENd && pOLENd->IsOLESizeInvalid() )
{
- pWrtShell->CalcLayout();
+ mpWrtShell->CalcLayout();
break;
}
}
@@ -1200,18 +1210,18 @@ uno::Reference< frame::XController >
void SwDocShell::setDocAccTitle( const OUString& rTitle )
{
- if (pDoc)
+ if (mpDoc)
{
- pDoc->setDocAccTitle( rTitle );
+ mpDoc->setDocAccTitle( rTitle );
}
}
const OUString SwDocShell::getDocAccTitle() const
{
OUString sRet;
- if (pDoc)
+ if (mpDoc)
{
- sRet = pDoc->getDocAccTitle();
+ sRet = mpDoc->getDocAccTitle();
}
return sRet;
@@ -1255,24 +1265,24 @@ OUString SwDocShell::GetEventName( sal_Int32 nIndex )
const ::sfx2::IXmlIdRegistry* SwDocShell::GetXmlIdRegistry() const
{
- return pDoc ? &pDoc->GetXmlIdRegistry() : 0;
+ return mpDoc ? &mpDoc->GetXmlIdRegistry() : 0;
}
bool SwDocShell::IsChangeRecording() const
{
- return (pWrtShell->GetRedlineMode() & nsRedlineMode_t::REDLINE_ON) != 0;
+ return (mpWrtShell->GetRedlineMode() & nsRedlineMode_t::REDLINE_ON) != 0;
}
bool SwDocShell::HasChangeRecordProtection() const
{
- return pWrtShell->getIDocumentRedlineAccess()->GetRedlinePassword().getLength() > 0;
+ return mpWrtShell->getIDocumentRedlineAccess()->GetRedlinePassword().getLength() > 0;
}
void SwDocShell::SetChangeRecording( bool bActivate )
{
sal_uInt16 nOn = bActivate ? nsRedlineMode_t::REDLINE_ON : 0;
- sal_uInt16 nMode = pWrtShell->GetRedlineMode();
- pWrtShell->SetRedlineModeAndCheckInsMode( (nMode & ~nsRedlineMode_t::REDLINE_ON) | nOn);
+ sal_uInt16 nMode = mpWrtShell->GetRedlineMode();
+ mpWrtShell->SetRedlineModeAndCheckInsMode( (nMode & ~nsRedlineMode_t::REDLINE_ON) | nOn);
}
bool SwDocShell::SetProtectionPassword( const OUString &rNewPassword )
@@ -1281,7 +1291,7 @@ bool SwDocShell::SetProtectionPassword( const OUString &rNewPassword )
const SfxItemSet* pArgs = &aSet;
const SfxPoolItem* pItem = NULL;
- IDocumentRedlineAccess* pIDRA = pWrtShell->getIDocumentRedlineAccess();
+ IDocumentRedlineAccess* pIDRA = mpWrtShell->getIDocumentRedlineAccess();
Sequence< sal_Int8 > aPasswd = pIDRA->GetRedlinePassword();
if (pArgs && SFX_ITEM_SET == pArgs->GetItemState( FN_REDLINE_PROTECT, false, &pItem )
&& ((SfxBoolItem*)pItem)->GetValue() == (aPasswd.getLength() > 0))
@@ -1316,7 +1326,7 @@ bool SwDocShell::GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal
const SfxItemSet* pArgs = &aSet;
const SfxPoolItem* pItem = NULL;
- IDocumentRedlineAccess* pIDRA = pWrtShell->getIDocumentRedlineAccess();
+ IDocumentRedlineAccess* pIDRA = mpWrtShell->getIDocumentRedlineAccess();
Sequence< sal_Int8 > aPasswdHash( pIDRA->GetRedlinePassword() );
if (pArgs && SFX_ITEM_SET == pArgs->GetItemState( FN_REDLINE_PROTECT, false, &pItem )
&& ((SfxBoolItem*)pItem)->GetValue() == (aPasswdHash.getLength() != 0))
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 74cbb0332481..e68a0d951db9 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -188,21 +188,21 @@ void SwDocShell::ToggleBrowserMode(bool bSet, SwView* _pView )
// update text fields on document properties changes
void SwDocShell::DoFlushDocInfo()
{
- if ( !pDoc ) return;
+ if ( !mpDoc ) return;
bool bUnlockView(true);
- if ( pWrtShell ) {
- bUnlockView = !pWrtShell->IsViewLocked();
- pWrtShell->LockView( true ); // lock visible section
- pWrtShell->StartAllAction();
+ if ( mpWrtShell ) {
+ bUnlockView = !mpWrtShell->IsViewLocked();
+ mpWrtShell->LockView( true ); // lock visible section
+ mpWrtShell->StartAllAction();
}
- pDoc->DocInfoChgd();
+ mpDoc->DocInfoChgd();
- if ( pWrtShell ) {
- pWrtShell->EndAllAction();
+ if ( mpWrtShell ) {
+ mpWrtShell->EndAllAction();
if ( bUnlockView ) {
- pWrtShell->LockView( false );
+ mpWrtShell->LockView( false );
}
}
}
@@ -229,12 +229,12 @@ static void lcl_processCompatibleSfxHint( const uno::Reference< script::vba::XVB
// Notification on DocInfo changes
void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if( !pDoc )
+ if( !mpDoc )
{
return ;
}
- uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = pDoc->GetVbaEventProcessor();
+ uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = mpDoc->GetVbaEventProcessor();
if( xVbaEvents.is() )
lcl_processCompatibleSfxHint( xVbaEvents, rHint );
@@ -260,16 +260,16 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
if( nAction )
{
bool bUnlockView = true; //initializing prevents warning
- if( pWrtShell )
+ if( mpWrtShell )
{
- bUnlockView = !pWrtShell->IsViewLocked();
- pWrtShell->LockView( true ); //lock visible section
- pWrtShell->StartAllAction();
+ bUnlockView = !mpWrtShell->IsViewLocked();
+ mpWrtShell->LockView( true ); //lock visible section
+ mpWrtShell->StartAllAction();
}
switch( nAction )
{
case 2:
- pDoc->GetSysFldType( RES_FILENAMEFLD )->UpdateFlds();
+ mpDoc->GetSysFldType( RES_FILENAMEFLD )->UpdateFlds();
break;
// #i38126# - own action for event LOADFINISHED
// in order to avoid a modified document.
@@ -282,24 +282,24 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
if ( bResetModified )
EnableSetModified( false );
// #i41679#
- const bool bIsDocModified = pDoc->IsModified();
+ const bool bIsDocModified = mpDoc->IsModified();
- pDoc->DocInfoChgd( );
+ mpDoc->DocInfoChgd( );
// #i41679#
if ( !bIsDocModified )
- pDoc->ResetModified();
+ mpDoc->ResetModified();
if ( bResetModified )
EnableSetModified( true );
}
break;
}
- if( pWrtShell )
+ if( mpWrtShell )
{
- pWrtShell->EndAllAction();
+ mpWrtShell->EndAllAction();
if( bUnlockView )
- pWrtShell->LockView( false );
+ mpWrtShell->LockView( false );
}
}
}
@@ -312,9 +312,9 @@ bool SwDocShell::PrepareClose( bool bUI )
if( nRet )
EndListening( *this );
- if( pDoc && IsInPrepareClose() )
+ if( mpDoc && IsInPrepareClose() )
{
- uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = pDoc->GetVbaEventProcessor();
+ uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = mpDoc->GetVbaEventProcessor();
if( xVbaEvents.is() )
{
using namespace com::sun::star::script::vba::VBAEventId;
@@ -694,7 +694,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
xDocSh->DoInitNew( 0 );
bool bImpress = FN_ABSTRACT_STARIMPRESS == nWhich;
- pDoc->Summary( pSmryDoc, nLevel, nPara, bImpress );
+ mpDoc->Summary( pSmryDoc, nLevel, nPara, bImpress );
if( bImpress )
{
WriterRef xWrt;
@@ -823,24 +823,24 @@ void SwDocShell::Execute(SfxRequest& rReq)
case SID_MAIL_PREPAREEXPORT:
{
//pWrtShell is not set in page preview
- if(pWrtShell)
- pWrtShell->StartAllAction();
- pDoc->UpdateFlds( NULL, false );
- pDoc->EmbedAllLinks();
- pDoc->RemoveInvisibleContent();
- if(pWrtShell)
- pWrtShell->EndAllAction();
+ if(mpWrtShell)
+ mpWrtShell->StartAllAction();
+ mpDoc->UpdateFlds( NULL, false );
+ mpDoc->EmbedAllLinks();
+ mpDoc->RemoveInvisibleContent();
+ if(mpWrtShell)
+ mpWrtShell->EndAllAction();
}
break;
case SID_MAIL_EXPORT_FINISHED:
{
- if(pWrtShell)
- pWrtShell->StartAllAction();
+ if(mpWrtShell)
+ mpWrtShell->StartAllAction();
//try to undo the removal of invisible content
- pDoc->RestoreInvisibleContent();
- if(pWrtShell)
- pWrtShell->EndAllAction();
+ mpDoc->RestoreInvisibleContent();
+ if(mpWrtShell)
+ mpWrtShell->EndAllAction();
}
break;
case FN_NEW_HTML_DOC:
@@ -942,7 +942,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
uno::Reference<XFilePickerControlAccess> xCtrlAcc(xFP, UNO_QUERY);
bool bOutline[MAXLEVEL] = {false};
- const SwOutlineNodes& rOutlNds = pDoc->GetNodes().GetOutLineNds();
+ const SwOutlineNodes& rOutlNds = mpDoc->GetNodes().GetOutLineNds();
if( !rOutlNds.empty() )
{
int nLevel;
@@ -954,7 +954,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
}
}
- const sal_uInt16 nStyleCount = pDoc->GetTxtFmtColls()->size();
+ const sal_uInt16 nStyleCount = mpDoc->GetTxtFmtColls()->size();
Sequence<OUString> aListBoxEntries( MAXLEVEL + nStyleCount);
OUString* pEntries = aListBoxEntries.getArray();
sal_Int32 nIdx = 0 ;
@@ -969,7 +969,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
OUString sStyle( SW_RESSTR(STR_FDLG_STYLE) );
for(sal_uInt16 i = 0; i < nStyleCount; ++i)
{
- SwTxtFmtColl &rTxtColl = *(*pDoc->GetTxtFmtColls())[ i ];
+ SwTxtFmtColl &rTxtColl = *(*mpDoc->GetTxtFmtColls())[ i ];
if( !rTxtColl.IsDefault() && rTxtColl.IsAtDocNodeSet() )
{
pEntries[nIdx++] = sStyle + rTxtColl.GetName();
@@ -1039,17 +1039,17 @@ void SwDocShell::Execute(SfxRequest& rReq)
if ( bCreateByOutlineLevel )
{
bDone = bCreateHtml
- ? pDoc->GenerateHTMLDoc( aFileName, nTemplateOutlineLevel )
- : pDoc->GenerateGlobalDoc( aFileName, nTemplateOutlineLevel );
+ ? mpDoc->GenerateHTMLDoc( aFileName, nTemplateOutlineLevel )
+ : mpDoc->GenerateGlobalDoc( aFileName, nTemplateOutlineLevel );
}
else
{
const SwTxtFmtColl* pSplitColl = 0;
if ( !aTemplateName.isEmpty() )
- pSplitColl = pDoc->FindTxtFmtCollByName(aTemplateName);
+ pSplitColl = mpDoc->FindTxtFmtCollByName(aTemplateName);
bDone = bCreateHtml
- ? pDoc->GenerateHTMLDoc( aFileName, pSplitColl )
- : pDoc->GenerateGlobalDoc( aFileName, pSplitColl );
+ ? mpDoc->GenerateHTMLDoc( aFileName, pSplitColl )
+ : mpDoc->GenerateGlobalDoc( aFileName, pSplitColl );
}
if( bDone )
{
@@ -1108,7 +1108,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
pViewShell = pVFrame ? pVFrame->GetViewShell() : 0;
pCurrView = dynamic_cast<SwView*>( pViewShell );
}
- pDoc->GetNumberFormatter(true)->SetYear2000(nYear2K);
+ mpDoc->GetNumberFormatter(true)->SetYear2000(nYear2K);
}
break;
case FN_OPEN_FILE:
@@ -1164,24 +1164,24 @@ void lcl_processCompatibleSfxHint( const uno::Reference< document::XVbaEventsHel
bool SwDocShell::DdeGetData( const OUString& rItem, const OUString& rMimeType,
uno::Any & rValue )
{
- return pDoc->GetData( rItem, rMimeType, rValue );
+ return mpDoc->GetData( rItem, rMimeType, rValue );
}
bool SwDocShell::DdeSetData( const OUString& rItem, const OUString& rMimeType,
const uno::Any & rValue )
{
- return pDoc->SetData( rItem, rMimeType, rValue );
+ return mpDoc->SetData( rItem, rMimeType, rValue );
}
::sfx2::SvLinkSource* SwDocShell::DdeCreateLinkSource( const OUString& rItem )
{
- return pDoc->CreateLinkSource( rItem );
+ return mpDoc->CreateLinkSource( rItem );
}
void SwDocShell::ReconnectDdeLink(SfxObjectShell& rServer)
{
- if ( pDoc ) {
- ::sfx2::LinkManager& rLinkManager = pDoc->GetLinkManager();
+ if ( mpDoc ) {
+ ::sfx2::LinkManager& rLinkManager = mpDoc->GetLinkManager();
rLinkManager.ReconnectDdeLink(rServer);
}
}
@@ -1208,7 +1208,7 @@ void SwDocShell::FillClass( SvGlobalName * pClassName,
}
// #FIXME check with new Event handling
#if 0
- uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper = pDoc->GetVbaEventsHelper();
+ uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper = mpDoc->GetVbaEventsHelper();
if( xVbaEventsHelper.is() )
lcl_processCompatibleSfxHint( xVbaEventsHelper, rHint );
#endif
@@ -1221,20 +1221,20 @@ void SwDocShell::SetModified( bool bSet )
SfxObjectShell::SetModified( bSet );
if( IsEnableSetModified())
{
- if (!pDoc->IsInCallModified() )
+ if (!mpDoc->IsInCallModified() )
{
EnableSetModified( false );
if( bSet )
{
- bool bOld = pDoc->IsModified();
- pDoc->SetModified();
+ bool bOld = mpDoc->IsModified();
+ mpDoc->SetModified();
if( !bOld )
{
- pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
+ mpDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
}
}
else
- pDoc->ResetModified();
+ mpDoc->ResetModified();
EnableSetModified( true );
}
@@ -1325,7 +1325,7 @@ void SwDocShell::ReloadFromHtml( const OUString& rStreamName, SwSrcView* pSrcVie
}
}
#endif
- bool bWasBrowseMode = pDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::BROWSE_MODE);
+ bool bWasBrowseMode = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::BROWSE_MODE);
RemoveLink();
// now also the UNO-Model has to be informed about the new Doc #51535#
@@ -1336,7 +1336,7 @@ void SwDocShell::ReloadFromHtml( const OUString& rStreamName, SwSrcView* pSrcVie
AddLink();
//#116402# update font list when new document is created
UpdateFontList();
- pDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::BROWSE_MODE, bWasBrowseMode);
+ mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::BROWSE_MODE, bWasBrowseMode);
pSrcView->SetPool(&GetPool());
const OUString& rMedname = GetMedium()->GetName();
@@ -1356,7 +1356,7 @@ void SwDocShell::ReloadFromHtml( const OUString& rStreamName, SwSrcView* pSrcVie
// the base URL has to be set to the filename of the document <rMedname>
// and not to the base URL of the temporary file <aMed> in order to get
// the URLs of the linked graphics correctly resolved.
- SwReloadFromHtmlReader aReader( aMed, rMedname, pDoc );
+ SwReloadFromHtmlReader aReader( aMed, rMedname, mpDoc );
aReader.Read( *ReadHTML );
@@ -1378,7 +1378,7 @@ void SwDocShell::ReloadFromHtml( const OUString& rStreamName, SwSrcView* pSrcVie
if(bModified && !IsReadOnly())
SetModified();
else
- pDoc->ResetModified();
+ mpDoc->ResetModified();
}
sal_uLong SwDocShell::LoadStylesFromFile( const OUString& rURL,
@@ -1436,13 +1436,13 @@ sal_uLong SwDocShell::LoadStylesFromFile( const OUString& rURL,
// insert the styles!
if( bUnoCall )
{
- SwNodeIndex aIdx( pDoc->GetNodes().GetEndOfContent(), -1 );
+ SwNodeIndex aIdx( mpDoc->GetNodes().GetEndOfContent(), -1 );
pPam.reset(new SwPaM( aIdx ));
pReader.reset(new SwReader( aMed, rURL, *pPam ));
}
else
{
- pReader.reset(new SwReader( aMed, rURL, *pWrtShell->GetCrsr() ));
+ pReader.reset(new SwReader( aMed, rURL, *mpWrtShell->GetCrsr() ));
}
pRead->GetReaderOpt().SetTxtFmts( rOpt.IsTxtFmts() );
@@ -1453,14 +1453,14 @@ sal_uLong SwDocShell::LoadStylesFromFile( const OUString& rURL,
if( bUnoCall )
{
- UnoActionContext aAction( pDoc );
+ UnoActionContext aAction( mpDoc );
nErr = pReader->Read( *pRead );
}
else
{
- pWrtShell->StartAllAction();
+ mpWrtShell->StartAllAction();
nErr = pReader->Read( *pRead );
- pWrtShell->EndAllAction();
+ mpWrtShell->EndAllAction();
}
}
diff --git a/sw/source/uibase/app/docshdrw.cxx b/sw/source/uibase/app/docshdrw.cxx
index 479aa30709d9..f24a98dc63b1 100644
--- a/sw/source/uibase/app/docshdrw.cxx
+++ b/sw/source/uibase/app/docshdrw.cxx
@@ -35,7 +35,7 @@ using namespace ::com::sun::star;
// Load Document
void SwDocShell::InitDraw()
{
- SdrModel *pDrDoc = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
+ SdrModel *pDrDoc = mpDoc->getIDocumentDrawModelAccess().GetDrawModel();
if( pDrDoc )
{
// create Lists and Tables DocShell's ItemSet
diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx
index cda1266afbd7..bc5b40a627b9 100644
--- a/sw/source/uibase/app/docshini.cxx
+++ b/sw/source/uibase/app/docshini.cxx
@@ -99,7 +99,7 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
bool bHTMLTemplSet = false;
if( bRet )
{
- AddLink(); // create pDoc / pIo if applicable
+ AddLink(); // create mpDoc / pIo if applicable
bool bWeb = ISA( SwWebDocShell );
if ( bWeb )
@@ -108,7 +108,7 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
GetDoc()->getIDocumentSettingAccess().set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true); // Globaldokument
if ( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
- SwTransferable::InitOle( this, *pDoc );
+ SwTransferable::InitOle( this, *mpDoc );
// set forbidden characters if necessary
SvxAsianConfig aAsian;
@@ -121,20 +121,20 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
ForbiddenCharacters aForbidden;
aAsian.GetStartEndChars( pLocales[i], aForbidden.beginLine, aForbidden.endLine);
LanguageType eLang = LanguageTag::convertToLanguageType(pLocales[i]);
- pDoc->getIDocumentSettingAccess().setForbiddenCharacters( eLang, aForbidden);
+ mpDoc->getIDocumentSettingAccess().setForbiddenCharacters( eLang, aForbidden);
}
}
- pDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::KERN_ASIAN_PUNCTUATION,
+ mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::KERN_ASIAN_PUNCTUATION,
!aAsian.IsKerningWesternTextOnly());
- pDoc->getIDocumentSettingAccess().setCharacterCompressionType(static_cast<SwCharCompressType>(aAsian.GetCharDistanceCompression()));
- pDoc->getIDocumentDeviceAccess().setPrintData(*SW_MOD()->GetPrtOptions(bWeb));
+ mpDoc->getIDocumentSettingAccess().setCharacterCompressionType(static_cast<SwCharCompressType>(aAsian.GetCharDistanceCompression()));
+ mpDoc->getIDocumentDeviceAccess().setPrintData(*SW_MOD()->GetPrtOptions(bWeb));
SubInitNew();
// for all
SwStdFontConfig* pStdFont = SW_MOD()->GetStdFontConfig();
- SfxPrinter* pPrt = pDoc->getIDocumentDeviceAccess().getPrinter( false );
+ SfxPrinter* pPrt = mpDoc->getIDocumentDeviceAccess().getPrinter( false );
OUString sEntry;
sal_uInt16 aFontWhich[] =
@@ -172,7 +172,7 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
sal_uInt16 nFontWhich = aFontWhich[i];
sal_uInt16 nFontId = aFontIds[i];
boost::scoped_ptr<SvxFontItem> pFontItem;
- const SvxLanguageItem& rLang = (const SvxLanguageItem&)pDoc->GetDefault( aLangTypes[i] );
+ const SvxLanguageItem& rLang = (const SvxLanguageItem&)mpDoc->GetDefault( aLangTypes[i] );
LanguageType eLanguage = rLang.GetLanguage();
if(!pStdFont->IsFontDefault(nFontId))
{
@@ -204,20 +204,20 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
pFontItem.reset(new SvxFontItem(aLangDefFont.GetFamily(), aLangDefFont.GetName(),
aEmptyOUStr, aLangDefFont.GetPitch(), aLangDefFont.GetCharSet(), nFontWhich));
}
- pDoc->SetDefault(*pFontItem);
+ mpDoc->SetDefault(*pFontItem);
if( !bHTMLTemplSet )
{
- SwTxtFmtColl *pColl = pDoc->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
+ SwTxtFmtColl *pColl = mpDoc->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
pColl->ResetFmtAttr(nFontWhich);
}
pFontItem.reset();
sal_Int32 nFontHeight = pStdFont->GetFontHeight( FONT_STANDARD, i, eLanguage );
if(nFontHeight <= 0)
nFontHeight = SwStdFontConfig::GetDefaultHeightFor( nFontId, eLanguage );
- pDoc->SetDefault(SvxFontHeightItem( nFontHeight, 100, aFontHeightWhich[i] ));
+ mpDoc->SetDefault(SvxFontHeightItem( nFontHeight, 100, aFontHeightWhich[i] ));
if( !bHTMLTemplSet )
{
- SwTxtFmtColl *pColl = pDoc->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
+ SwTxtFmtColl *pColl = mpDoc->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
pColl->ResetFmtAttr(aFontHeightWhich[i]);
}
@@ -240,20 +240,20 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
sal_uInt16 nFontWhich = RES_CHRATR_FONT;
sal_uInt16 nFontHeightWhich = RES_CHRATR_FONTSIZE;
- LanguageType eLanguage = static_cast<const SvxLanguageItem&>(pDoc->GetDefault( RES_CHRATR_LANGUAGE )).GetLanguage();
+ LanguageType eLanguage = static_cast<const SvxLanguageItem&>(mpDoc->GetDefault( RES_CHRATR_LANGUAGE )).GetLanguage();
for(sal_uInt8 nIdx = 0; nIdx < 24; nIdx += 2)
{
if(nIdx == 8)
{
nFontWhich = RES_CHRATR_CJK_FONT;
nFontHeightWhich = RES_CHRATR_CJK_FONTSIZE;
- eLanguage = static_cast<const SvxLanguageItem&>(pDoc->GetDefault( RES_CHRATR_CJK_LANGUAGE )).GetLanguage();
+ eLanguage = static_cast<const SvxLanguageItem&>(mpDoc->GetDefault( RES_CHRATR_CJK_LANGUAGE )).GetLanguage();
}
else if(nIdx == 16)
{
nFontWhich = RES_CHRATR_CTL_FONT;
nFontHeightWhich = RES_CHRATR_CTL_FONTSIZE;
- eLanguage = static_cast<const SvxLanguageItem&>(pDoc->GetDefault( RES_CHRATR_CTL_LANGUAGE )).GetLanguage();
+ eLanguage = static_cast<const SvxLanguageItem&>(mpDoc->GetDefault( RES_CHRATR_CTL_LANGUAGE )).GetLanguage();
}
SwTxtFmtColl *pColl = 0;
if(!pStdFont->IsFontDefault(aFontIdPoolId[nIdx]))
@@ -264,7 +264,7 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
if( pPrt )
aFont = pPrt->GetFontMetric( aFont );
- pColl = pDoc->GetTxtCollFromPool(aFontIdPoolId[nIdx + 1]);
+ pColl = mpDoc->GetTxtCollFromPool(aFontIdPoolId[nIdx + 1]);
if( !bHTMLTemplSet ||
SFX_ITEM_SET != pColl->GetAttrSet().GetItemState(
nFontWhich, false ) )
@@ -277,7 +277,7 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
if(nFontHeight <= 0)
nFontHeight = SwStdFontConfig::GetDefaultHeightFor( aFontIdPoolId[nIdx], eLanguage );
if(!pColl)
- pColl = pDoc->GetTxtCollFromPool(aFontIdPoolId[nIdx + 1]);
+ pColl = mpDoc->GetTxtCollFromPool(aFontIdPoolId[nIdx + 1]);
SvxFontHeightItem aFontHeight( (const SvxFontHeightItem&)pColl->GetFmtAttr( nFontHeightWhich, true ));
if(aFontHeight.GetHeight() != sal::static_int_cast<sal_uInt32, sal_Int32>(nFontHeight))
{
@@ -289,7 +289,7 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
// the default for documents created via 'File/New' should be 'on'
// (old documents, where this property was not yet implemented, will get the
// value 'false' in the SwDoc c-tor)
- pDoc->getIDocumentSettingAccess().set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT,
+ mpDoc->getIDocumentSettingAccess().set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT,
SW_MOD()->GetUsrPref( bWeb )->IsAlignMathObjectsToBaseline() );
}
@@ -297,19 +297,19 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
the default adjusment is to the right. */
if( !bHTMLTemplSet &&
FRMDIR_HORI_RIGHT_TOP == GetDefaultFrameDirection(GetAppLanguage()) )
- pDoc->SetDefault( SvxAdjustItem(SVX_ADJUST_RIGHT, RES_PARATR_ADJUST ) );
+ mpDoc->SetDefault( SvxAdjustItem(SVX_ADJUST_RIGHT, RES_PARATR_ADJUST ) );
// #i29550#
- pDoc->SetDefault( SfxBoolItem( RES_COLLAPSING_BORDERS, true ) );
+ mpDoc->SetDefault( SfxBoolItem( RES_COLLAPSING_BORDERS, true ) );
// <-- collapsing
//#i16874# AutoKerning as default for new documents
- pDoc->SetDefault( SvxAutoKernItem( true, RES_CHRATR_AUTOKERN ) );
+ mpDoc->SetDefault( SvxAutoKernItem( true, RES_CHRATR_AUTOKERN ) );
// #i42080# - Due to the several calls of method <SetDefault(..)>
// at the document instance, the document is modified. Thus, reset this
// status here. Note: In method <SubInitNew()> this is also done.
- pDoc->ResetModified();
+ mpDoc->ResetModified();
return bRet;
}
@@ -317,13 +317,13 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
// Ctor with SfxCreateMode ?????
SwDocShell::SwDocShell( SfxObjectCreateMode eMode ) :
SfxObjectShell ( eMode ),
- pDoc(0),
- pFontList(0),
- pView( 0 ),
- pWrtShell( 0 ),
- pOLEChildList( 0 ),
- nUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
- bInUpdateFontList(false),
+ mpDoc(0),
+ mpFontList(0),
+ mbInUpdateFontList(false),
+ mpView( 0 ),
+ mpWrtShell( 0 ),
+ mpOLEChildList( 0 ),
+ mnUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
bIsATemplate(false)
{
Init_Impl();
@@ -332,13 +332,13 @@ SwDocShell::SwDocShell( SfxObjectCreateMode eMode ) :
// Ctor / Dtor
SwDocShell::SwDocShell( const sal_uInt64 i_nSfxCreationFlags ) :
SfxObjectShell ( i_nSfxCreationFlags ),
- pDoc(0),
- pFontList(0),
- pView( 0 ),
- pWrtShell( 0 ),
- pOLEChildList( 0 ),
- nUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
- bInUpdateFontList(false),
+ mpDoc(0),
+ mpFontList(0),
+ mbInUpdateFontList(false),
+ mpView( 0 ),
+ mpWrtShell( 0 ),
+ mpOLEChildList( 0 ),
+ mnUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
bIsATemplate(false)
{
Init_Impl();
@@ -347,13 +347,13 @@ SwDocShell::SwDocShell( const sal_uInt64 i_nSfxCreationFlags ) :
// Ctor / Dtor
SwDocShell::SwDocShell( SwDoc *pD, SfxObjectCreateMode eMode ):
SfxObjectShell ( eMode ),
- pDoc(pD),
- pFontList(0),
- pView( 0 ),
- pWrtShell( 0 ),
- pOLEChildList( 0 ),
- nUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
- bInUpdateFontList(false),
+ mpDoc(pD),
+ mpFontList(0),
+ mbInUpdateFontList(false),
+ mpView( 0 ),
+ mpWrtShell( 0 ),
+ mpOLEChildList( 0 ),
+ mnUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
bIsATemplate(false)
{
Init_Impl();
@@ -363,22 +363,22 @@ SwDocShell::SwDocShell( SwDoc *pD, SfxObjectCreateMode eMode ):
SwDocShell::~SwDocShell()
{
// disable chart related objects now because in ~SwDoc it may be to late for this
- if( pDoc )
+ if( mpDoc )
{
- pDoc->GetChartControllerHelper().Disconnect();
- SwChartDataProvider *pPCD = pDoc->GetChartDataProvider();
+ mpDoc->GetChartControllerHelper().Disconnect();
+ SwChartDataProvider *pPCD = mpDoc->GetChartDataProvider();
if (pPCD)
pPCD->dispose();
}
RemoveLink();
- delete pFontList;
+ delete mpFontList;
// we, as BroadCaster also become our own Listener
// (for DocInfo/FileNames/....)
EndListening( *this );
- delete pOLEChildList;
+ delete mpOLEChildList;
}
void SwDocShell::Init_Impl()
@@ -397,39 +397,39 @@ void SwDocShell::Init_Impl()
void SwDocShell::AddLink()
{
- if( !pDoc )
+ if( !mpDoc )
{
SwDocFac aFactory;
- pDoc = aFactory.GetDoc();
- pDoc->acquire();
- pDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::HTML_MODE, ISA(SwWebDocShell) );
+ mpDoc = aFactory.GetDoc();
+ mpDoc->acquire();
+ mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::HTML_MODE, ISA(SwWebDocShell) );
}
else
- pDoc->acquire();
- pDoc->SetDocShell( this ); // set the DocShell-Pointer for Doc
+ mpDoc->acquire();
+ mpDoc->SetDocShell( this ); // set the DocShell-Pointer for Doc
uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY);
((SwXTextDocument*)xDoc.get())->Reactivate(this);
- SetPool(&pDoc->GetAttrPool());
+ SetPool(&mpDoc->GetAttrPool());
// most suitably not until a sdbcx::View is created!!!
- pDoc->SetOle2Link(LINK(this, SwDocShell, Ole2ModifiedHdl));
+ mpDoc->SetOle2Link(LINK(this, SwDocShell, Ole2ModifiedHdl));
}
// create new FontList Change Printer
void SwDocShell::UpdateFontList()
{
- if(!bInUpdateFontList)
+ if(!mbInUpdateFontList)
{
- bInUpdateFontList = true;
- OSL_ENSURE(pDoc, "No Doc no FontList");
- if( pDoc )
+ mbInUpdateFontList = true;
+ OSL_ENSURE(mpDoc, "No Doc no FontList");
+ if( mpDoc )
{
- delete pFontList;
- pFontList = new FontList( pDoc->getIDocumentDeviceAccess().getReferenceDevice( true ) );
- PutItem( SvxFontListItem( pFontList, SID_ATTR_CHAR_FONTLIST ) );
+ delete mpFontList;
+ mpFontList = new FontList( mpDoc->getIDocumentDeviceAccess().getReferenceDevice( true ) );
+ PutItem( SvxFontListItem( mpFontList, SID_ATTR_CHAR_FONTLIST ) );
}
- bInUpdateFontList = false;
+ mbInUpdateFontList = false;
}
}
@@ -439,19 +439,19 @@ void SwDocShell::RemoveLink()
uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY);
((SwXTextDocument*)xDoc.get())->Invalidate();
aFinishedTimer.Stop();
- if(pDoc)
+ if (mpDoc)
{
if( mxBasePool.is() )
{
static_cast<SwDocStyleSheetPool*>(mxBasePool.get())->dispose();
mxBasePool.clear();
}
- sal_Int8 nRefCt = static_cast< sal_Int8 >(pDoc->release());
- pDoc->SetOle2Link(Link());
- pDoc->SetDocShell( 0 );
+ sal_Int8 nRefCt = static_cast< sal_Int8 >(mpDoc->release());
+ mpDoc->SetOle2Link(Link());
+ mpDoc->SetDocShell( 0 );
if( !nRefCt )
- delete pDoc;
- pDoc = 0; // we don't have the Doc anymore!!
+ delete mpDoc;
+ mpDoc = 0; // we don't have the Doc anymore!!
}
}
void SwDocShell::InvalidateModel()
@@ -474,7 +474,7 @@ bool SwDocShell::Load( SfxMedium& rMedium )
if( SfxObjectShell::Load( rMedium ))
{
SAL_INFO( "sw.ui", "after SfxInPlaceObject::Load" );
- if( pDoc ) // for last version!!
+ if (mpDoc) // for last version!!
RemoveLink(); // release the existing
AddLink(); // set Link and update Data!!
@@ -482,11 +482,11 @@ bool SwDocShell::Load( SfxMedium& rMedium )
// Loading
// for MD
OSL_ENSURE( !mxBasePool.is(), "who hasn't destroyed their Pool?" );
- mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
+ mxBasePool = new SwDocStyleSheetPool( *mpDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
if(GetCreateMode() != SFX_CREATE_MODE_ORGANIZER)
{
SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, false);
- nUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE;
+ mnUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE;
}
SwWait aWait( *this, true );
@@ -498,7 +498,7 @@ bool SwDocShell::Load( SfxMedium& rMedium )
if( ReadXML )
{
ReadXML->SetOrganizerMode( true );
- SwReader aRdr( rMedium, aEmptyOUStr, pDoc );
+ SwReader aRdr( rMedium, aEmptyOUStr, mpDoc );
nErr = aRdr.Read( *ReadXML );
ReadXML->SetOrganizerMode( false );
}
@@ -509,7 +509,7 @@ bool SwDocShell::Load( SfxMedium& rMedium )
case SFX_CREATE_MODE_EMBEDDED:
{
// for MWERKS (Mac-Compiler): can't cast autonomously
- SwTransferable::InitOle( this, *pDoc );
+ SwTransferable::InitOle( this, *mpDoc );
}
// suppress SfxProgress, when we are Embedded
SW_MOD()->SetEmbeddedLoadSave( true );
@@ -523,7 +523,7 @@ bool SwDocShell::Load( SfxMedium& rMedium )
{
// set Doc's DocInfo at DocShell-Medium
SAL_INFO( "sw.ui", "before ReadDocInfo" );
- SwReader aRdr( rMedium, aEmptyOUStr, pDoc );
+ SwReader aRdr( rMedium, aEmptyOUStr, mpDoc );
SAL_INFO( "sw.ui", "before Read" );
nErr = aRdr.Read( *pReader );
SAL_INFO( "sw.ui", "after Read" );
@@ -532,13 +532,13 @@ bool SwDocShell::Load( SfxMedium& rMedium )
// by this formats.
if( ISA( SwWebDocShell ) )
{
- if( !pDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::HTML_MODE) )
- pDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::HTML_MODE, true);
+ if( !mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::HTML_MODE) )
+ mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::HTML_MODE, true);
}
if( ISA( SwGlobalDocShell ) )
{
- if( !pDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::GLOBAL_DOCUMENT) )
- pDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true);
+ if( !mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::GLOBAL_DOCUMENT) )
+ mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true);
}
}
}
@@ -554,7 +554,7 @@ bool SwDocShell::Load( SfxMedium& rMedium )
SetError( nErr, OUString( OSL_LOG_PREFIX ) );
bRet = !IsError( nErr );
- if ( bRet && !pDoc->IsInLoadAsynchron() &&
+ if ( bRet && !mpDoc->IsInLoadAsynchron() &&
GetCreateMode() == SFX_CREATE_MODE_STANDARD )
{
LoadingFinished();
@@ -570,7 +570,7 @@ bool SwDocShell::Load( SfxMedium& rMedium )
bool SwDocShell::LoadFrom( SfxMedium& rMedium )
{
bool bRet = false;
- if( pDoc )
+ if( mpDoc )
RemoveLink();
AddLink(); // set Link and update Data!!
@@ -585,11 +585,11 @@ bool SwDocShell::LoadFrom( SfxMedium& rMedium )
SwWait aWait( *this, true );
{
OSL_ENSURE( !mxBasePool.is(), "who hasn't destroyed their Pool?" );
- mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
+ mxBasePool = new SwDocStyleSheetPool( *mpDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
if( ReadXML )
{
ReadXML->SetOrganizerMode( true );
- SwReader aRdr( rMedium, aEmptyOUStr, pDoc );
+ SwReader aRdr( rMedium, aEmptyOUStr, mpDoc );
nErr = aRdr.Read( *ReadXML );
ReadXML->SetOrganizerMode( false );
}
@@ -606,19 +606,19 @@ bool SwDocShell::LoadFrom( SfxMedium& rMedium )
} while( false );
SfxObjectShell::LoadFrom( rMedium );
- pDoc->ResetModified();
+ mpDoc->ResetModified();
return bRet;
}
void SwDocShell::SubInitNew()
{
OSL_ENSURE( !mxBasePool.is(), "who hasn't destroyed their Pool?" );
- mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
+ mxBasePool = new SwDocStyleSheetPool( *mpDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
UpdateFontList();
InitDraw();
- pDoc->getIDocumentSettingAccess().setLinkUpdateMode( GLOBALSETTING );
- pDoc->getIDocumentSettingAccess().setFieldUpdateFlags( AUTOUPD_GLOBALSETTING );
+ mpDoc->getIDocumentSettingAccess().setLinkUpdateMode( GLOBALSETTING );
+ mpDoc->getIDocumentSettingAccess().setFieldUpdateFlags( AUTOUPD_GLOBALSETTING );
bool bWeb = ISA(SwWebDocShell);
@@ -634,7 +634,7 @@ void SwDocShell::SubInitNew()
nRange[ (sizeof(nRange)/sizeof(nRange[0])) - 3 ] = RES_PARATR_TABSTOP;
nRange[ (sizeof(nRange)/sizeof(nRange[0])) - 2 ] = RES_PARATR_HYPHENZONE;
}
- SfxItemSet aDfltSet( pDoc->GetAttrPool(), nRange );
+ SfxItemSet aDfltSet( mpDoc->GetAttrPool(), nRange );
//! get lingu options without loading lingu DLL
SvtLinguOptions aLinguOpt;
@@ -650,7 +650,7 @@ void SwDocShell::SubInitNew()
if(!bWeb)
{
- SvxHyphenZoneItem aHyp( (SvxHyphenZoneItem&) pDoc->GetDefault(
+ SvxHyphenZoneItem aHyp( (SvxHyphenZoneItem&) mpDoc->GetDefault(
RES_PARATR_HYPHENZONE) );
aHyp.GetMinLead() = static_cast< sal_uInt8 >(aLinguOpt.nHyphMinLeading);
aHyp.GetMinTrail() = static_cast< sal_uInt8 >(aLinguOpt.nHyphMinTrailing);
@@ -664,23 +664,23 @@ void SwDocShell::SubInitNew()
}
aDfltSet.Put( SvxColorItem( Color( COL_AUTO ), RES_CHRATR_COLOR ) );
- pDoc->SetDefault( aDfltSet );
+ mpDoc->SetDefault( aDfltSet );
//default page mode for text grid
if(!bWeb)
{
bool bSquaredPageMode = SW_MOD()->GetUsrPref(false)->IsSquaredPageMode();
- pDoc->SetDefaultPageMode( bSquaredPageMode );
+ mpDoc->SetDefaultPageMode( bSquaredPageMode );
}
- pDoc->ResetModified();
+ mpDoc->ResetModified();
}
/*
* Document Interface Access
*/
-IDocumentDeviceAccess* SwDocShell::getIDocumentDeviceAccess() { return &pDoc->getIDocumentDeviceAccess(); }
-const IDocumentSettingAccess* SwDocShell::getIDocumentSettingAccess() const { return &pDoc->getIDocumentSettingAccess(); }
-IDocumentChartDataProviderAccess* SwDocShell::getIDocumentChartDataProviderAccess() { return pDoc; }
+IDocumentDeviceAccess* SwDocShell::getIDocumentDeviceAccess() { return &mpDoc->getIDocumentDeviceAccess(); }
+const IDocumentSettingAccess* SwDocShell::getIDocumentSettingAccess() const { return &mpDoc->getIDocumentSettingAccess(); }
+IDocumentChartDataProviderAccess* SwDocShell::getIDocumentChartDataProviderAccess() { return mpDoc; }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index ec4332cc4fe8..da3aab0265a1 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -159,7 +159,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
SfxTemplateItem aItem(nWhich, aName);
sal_uInt16 nMask = 0;
- if( pDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::HTML_MODE) )
+ if( mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::HTML_MODE) )
nMask = SWSTYLEBIT_HTML;
else
{
@@ -185,7 +185,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
case SID_STYLE_FAMILY3:
- if( pDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::HTML_MODE) )
+ if( mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::HTML_MODE) )
rSet.DisableItem( nWhich );
else
{
@@ -201,7 +201,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
case SID_STYLE_FAMILY4:
{
SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
- if( pDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::HTML_MODE) && !rHtmlOpt.IsPrintLayoutExtension())
+ if( mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::HTML_MODE) && !rHtmlOpt.IsPrintLayoutExtension())
rSet.DisableItem( nWhich );
else
{
@@ -421,14 +421,14 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
break;
case SFX_STYLE_FAMILY_FRAME:
{
- SwFrmFmt* pFrm = pWrtShell->GetCurFrmFmt();
+ SwFrmFmt* pFrm = mpWrtShell->GetCurFrmFmt();
if( pFrm )
aParam = pFrm->GetName();
}
break;
case SFX_STYLE_FAMILY_CHAR:
{
- SwCharFmt* pChar = pWrtShell->GetCurCharFmt();
+ SwCharFmt* pChar = mpWrtShell->GetCurCharFmt();
if( pChar )
aParam = pChar->GetName();
}
@@ -624,7 +624,7 @@ sal_uInt16 SwDocShell::Edit(
SfxStyleSheetBase *pStyle = 0;
sal_uInt16 nRet = nMask;
- bool bModified = pDoc->IsModified();
+ bool bModified = mpDoc->IsModified();
if( bNew )
{
@@ -643,12 +643,12 @@ sal_uInt16 SwDocShell::Edit(
{
if(!rParent.isEmpty())
{
- SwTxtFmtColl* pColl = pWrtShell->FindTxtFmtCollByName( rParent );
+ SwTxtFmtColl* pColl = mpWrtShell->FindTxtFmtCollByName( rParent );
if(!pColl)
{
sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL);
if(USHRT_MAX != nId)
- pColl = pWrtShell->GetTxtCollFromPool( nId );
+ pColl = mpWrtShell->GetTxtCollFromPool( nId );
}
pDStyle->GetCollection()->SetDerivedFrom( pColl );
pDStyle->PresetParent( rParent );
@@ -666,7 +666,7 @@ sal_uInt16 SwDocShell::Edit(
}
else
{
- SwTxtFmtColl* pColl = pWrtShell->GetCurTxtFmtColl();
+ SwTxtFmtColl* pColl = mpWrtShell->GetCurTxtFmtColl();
pDStyle->GetCollection()->SetDerivedFrom( pColl );
if( pColl )
pDStyle->PresetParent( pColl->GetName() );
@@ -677,12 +677,12 @@ sal_uInt16 SwDocShell::Edit(
{
if(!rParent.isEmpty())
{
- SwCharFmt* pCFmt = pWrtShell->FindCharFmtByName( rParent );
+ SwCharFmt* pCFmt = mpWrtShell->FindCharFmtByName( rParent );
if(!pCFmt)
{
sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT);
if(USHRT_MAX != nId)
- pCFmt = pWrtShell->GetCharFmtFromPool( nId );
+ pCFmt = mpWrtShell->GetCharFmtFromPool( nId );
}
pDStyle->GetCharFmt()->SetDerivedFrom( pCFmt );
@@ -690,7 +690,7 @@ sal_uInt16 SwDocShell::Edit(
}
else
{
- SwCharFmt* pCFmt = pWrtShell->GetCurCharFmt();
+ SwCharFmt* pCFmt = mpWrtShell->GetCurCharFmt();
pDStyle->GetCharFmt()->SetDerivedFrom( pCFmt );
if( pCFmt )
pDStyle->PresetParent( pCFmt->GetName() );
@@ -701,12 +701,12 @@ sal_uInt16 SwDocShell::Edit(
{
if(!rParent.isEmpty())
{
- SwFrmFmt* pFFmt = pWrtShell->GetDoc()->FindFrmFmtByName( rParent );
+ SwFrmFmt* pFFmt = mpWrtShell->GetDoc()->FindFrmFmtByName( rParent );
if(!pFFmt)
{
sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT);
if(USHRT_MAX != nId)
- pFFmt = pWrtShell->GetFrmFmtFromPool( nId );
+ pFFmt = mpWrtShell->GetFrmFmtFromPool( nId );
}
pDStyle->GetFrmFmt()->SetDerivedFrom( pFFmt );
pDStyle->PresetParent( rParent );
@@ -761,7 +761,7 @@ sal_uInt16 SwDocShell::Edit(
// In HTML mode, we do not always have a printer. In order to show
// the correct page size in the Format - Page dialog, we have to
// get one here.
- SwWrtShell* pCurrShell = ( pActShell ? pActShell : pWrtShell );
+ SwWrtShell* pCurrShell = ( pActShell ? pActShell : mpWrtShell );
if( ( HTMLMODE_ON & nHtmlMode ) &&
!pCurrShell->getIDocumentDeviceAccess()->getPrinter( false ) )
pCurrShell->InitPrt( pCurrShell->getIDocumentDeviceAccess()->getPrinter( true ) );
@@ -773,7 +773,7 @@ sal_uInt16 SwDocShell::Edit(
assert( pFact );
boost::scoped_ptr<SfxAbstractApplyTabDialog> pDlg(pFact->CreateTemplateDialog(
0, *(xTmp.get()), nFamily, sPage,
- pActShell ? pActShell : pWrtShell, bNew));
+ pActShell ? pActShell : mpWrtShell, bNew));
assert( pDlg );
ApplyStyle aApplyStyleHelper(*this, bNew, pStyle, nRet, xTmp, nFamily, pDlg.get(), mxBasePool, bModified);
pDlg->SetApplyHdl(LINK(&aApplyStyleHelper, ApplyStyle, ApplyHdl));
@@ -787,11 +787,11 @@ sal_uInt16 SwDocShell::Edit(
if( bNew )
{
GetWrtShell()->Undo(1);
- pDoc->GetIDocumentUndoRedo().ClearRedo();
+ mpDoc->GetIDocumentUndoRedo().ClearRedo();
}
if( !bModified )
- pDoc->ResetModified();
+ mpDoc->ResetModified();
}
nRet = aApplyStyleHelper.getRet();
@@ -820,15 +820,15 @@ sal_uInt16 SwDocShell::Edit(
::ConvertAttrGenToChar(xTmp->GetItemSet(), CONV_ATTR_STD);
}
if(SFX_STYLE_FAMILY_PAGE == nFamily)
- pView->InvalidateRulerPos();
+ mpView->InvalidateRulerPos();
if( bNew )
mxBasePool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *xTmp.get() ) );
- pDoc->SetModified();
+ mpDoc->SetModified();
if( !bModified ) // Bug 57028
{
- pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
+ mpDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
}
GetWrtShell()->EndAllAction();
}
@@ -938,7 +938,7 @@ sal_uInt16 SwDocShell::DoWaterCan(const OUString &rName, sal_uInt16 nFamily)
{
assert( GetWrtShell() );
- SwEditWin& rEdtWin = pView->GetEditWin();
+ SwEditWin& rEdtWin = mpView->GetEditWin();
SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate();
bool bWaterCan = !(pApply && pApply->eType != 0);
@@ -982,7 +982,7 @@ sal_uInt16 SwDocShell::DoWaterCan(const OUString &rName, sal_uInt16 nFamily)
else
aTemplate.eType = 0;
- pView->GetEditWin().SetApplyTemplate(aTemplate);
+ mpView->GetEditWin().SetApplyTemplate(aTemplate);
return nFamily;
}
@@ -1247,27 +1247,27 @@ void SwDocShell::_LoadStyles( SfxObjectShell& rSource, bool bPreserveCurrentDocu
// of the template, update all the Source's
// FixFields once.
if(!bPreserveCurrentDocument)
- ((SwDocShell&)rSource).pDoc->SetFixFields(false, NULL);
- if( pWrtShell )
+ ((SwDocShell&)rSource).mpDoc->SetFixFields(false, NULL);
+ if( mpWrtShell )
{
// rhbz#818557, fdo#58893: EndAllAction will call SelectShell(),
// which pushes a bunch of SfxShells that are not cleared
// (for unknown reasons) when closing the document, causing crash;
// setting bNoInterrupt appears to avoid the problem.
::comphelper::FlagRestorationGuard g(bNoInterrupt, true);
- pWrtShell->StartAllAction();
- pDoc->ReplaceStyles( *((SwDocShell&)rSource).pDoc );
- pWrtShell->EndAllAction();
+ mpWrtShell->StartAllAction();
+ mpDoc->ReplaceStyles( *((SwDocShell&)rSource).mpDoc );
+ mpWrtShell->EndAllAction();
}
else
{
- bool bModified = pDoc->IsModified();
- pDoc->ReplaceStyles( *((SwDocShell&)rSource).pDoc );
- if( !bModified && pDoc->IsModified() && !pView )
+ bool bModified = mpDoc->IsModified();
+ mpDoc->ReplaceStyles( *((SwDocShell&)rSource).mpDoc );
+ if( !bModified && mpDoc->IsModified() && !mpView )
{
// the View is created later, but overwrites the Modify-Flag.
// Undo doesn't work anymore anyways.
- pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
+ mpDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
}
}
}