summaryrefslogtreecommitdiff
path: root/sw/source/ui/app/docsh.cxx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2006-08-14 16:26:15 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2006-08-14 16:26:15 +0000
commit41091049d3aacb6d772bd6e9d1fb4aea011f8c0f (patch)
tree53d4e2ef47a17b86277dd06a8772dbacb4e0cf3c /sw/source/ui/app/docsh.cxx
parent8c0d6058e00225c7de695717681ce19fcf1d434f (diff)
INTEGRATION: CWS writercorehandoff (1.51.54); FILE MERGED
2006/07/31 06:24:02 fme 1.51.54.17: #i50348# Resync 2006/07/27 14:54:35 fme 1.51.54.16: RESYNC: (1.57-1.59); FILE MERGED 2006/04/11 09:59:17 tra 1.51.54.15: #i50348 2006/04/05 13:24:05 tra 1.51.54.14: RESYNC: (1.56-1.57); FILE MERGED 2006/03/17 08:26:12 tra 1.51.54.13: RESYNC: (1.55-1.56); FILE MERGED 2005/12/20 15:31:54 tra 1.51.54.12: RESYNC: (1.54-1.55); FILE MERGED 2005/10/25 08:43:07 tra 1.51.54.11: RESYNC: (1.53-1.54); FILE MERGED 2005/09/13 15:52:19 tra 1.51.54.10: RESYNC: (1.52-1.53); FILE MERGED 2005/07/19 13:28:10 tra 1.51.54.9: RESYNC: (1.51-1.52); FILE MERGED 2005/07/14 05:01:30 fme 1.51.54.8: #i50348# Make SwDoc accessible via interfaces 2005/07/13 13:24:44 fme 1.51.54.7: #i50348# Make SwDoc accessible via interfaces 2005/07/13 05:26:11 tra 1.51.54.6: #i50348#make SwDoc interface based 2005/07/12 11:21:51 tra 1.51.54.5: #i50348#make SwDoc interface based 2005/07/11 05:11:47 tra 1.51.54.4: #i50348#make SwDoc interface based 2005/06/24 11:43:50 fme 1.51.54.3: #i50348# Make SwDoc accessible via interfaces 2005/06/07 14:15:18 fme 1.51.54.2: #i50348# General cleanup - removed unused header files, functions, members, declarations etc. 2005/06/06 09:29:12 tra 1.51.54.1: Unnecessary includes removed #i50348#
Diffstat (limited to 'sw/source/ui/app/docsh.cxx')
-rw-r--r--sw/source/ui/app/docsh.cxx70
1 files changed, 33 insertions, 37 deletions
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index e84a6aa87bc0..0666a998a518 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: docsh.cxx,v $
*
- * $Revision: 1.59 $
+ * $Revision: 1.60 $
*
- * last change: $Author: kz $ $Date: 2006-07-19 09:36:15 $
+ * last change: $Author: hr $ $Date: 2006-08-14 17:26:15 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,7 +33,6 @@
*
************************************************************************/
-
#pragma hdrstop
#ifndef _HINTIDS_HXX
@@ -279,9 +278,6 @@ using namespace ::com::sun::star::uno;
#ifndef _SWSLOTS_HXX
#include <swslots.hxx>
#endif
-#ifndef _COM_SUN_STAR_SCRIPT_XLIBRARYCONTAINER_HPP_
-#include <com/sun/star/script/XLibraryContainer.hpp>
-#endif
#ifndef _COM_SUN_STAR_DOCUMENT_UPDATEDOCMODE_HPP_
#include <com/sun/star/document/UpdateDocMode.hpp>
#endif
@@ -432,7 +428,7 @@ BOOL SwDocShell::ConvertFrom( SfxMedium& rMedium )
SW_MOD()->SetEmbeddedLoadSave(
SFX_CREATE_MODE_EMBEDDED == GetCreateMode() );
- pRdr->GetDoc()->SetHTMLMode( ISA(SwWebDocShell) );
+ pRdr->GetDoc()->set(IDocumentSettingAccess::HTML_MODE, ISA(SwWebDocShell));
/* #106748# Restore the pool default if reading a saved document. */
pDoc->RemoveAllFmtLanguageDependencies();
@@ -501,10 +497,10 @@ BOOL SwDocShell::Save()
// --> OD 2006-03-17 #i62875#
// reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible
if ( pWrtShell && pDoc &&
- pDoc->DoNotCaptureDrawObjsOnPage() &&
+ pDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
docfunc::AllDrawObjsOnPage( *pDoc ) )
{
- pDoc->SetDoNotCaptureDrawObjsOnPage( false );
+ pDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
}
// <--
@@ -596,7 +592,8 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium )
if(pView)
pView->GetEditWin().StopQuickHelp();
- if( pDoc->IsGlobalDoc() && !pDoc->IsGlblDocSaveLinks() )
+ if( pDoc->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) &&
+ !pDoc->get(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS) )
RemoveOLEObjects();
{
@@ -625,22 +622,22 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium )
// --> OD 2006-03-17 #i62875#
// reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible
if ( pWrtShell && pDoc &&
- pDoc->DoNotCaptureDrawObjsOnPage() &&
+ pDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
docfunc::AllDrawObjsOnPage( *pDoc ) )
{
- pDoc->SetDoNotCaptureDrawObjsOnPage( false );
+ pDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
}
// <--
- sal_uInt16 nRedlineMode = pDoc->GetRedlineMode();
+ IDocumentRedlineAccess::RedlineMode_t nRedlineMode = pDoc->GetRedlineMode();
// Hide redlines for export
- pDoc->SetRedlineMode( REDLINE_SHOW_INSERT );
+ pDoc->SetRedlineMode( IDocumentRedlineAccess::REDLINE_SHOW_INSERT );
ULONG nErr = ERR_SWG_WRITE_ERROR, nVBWarning = ERRCODE_NONE;
uno::Reference < embed::XStorage > xStor = rMedium.GetOutputStorage();
if( SfxObjectShell::SaveAs( rMedium ) )
{
- if( GetDoc()->IsGlobalDoc() && !ISA( SwGlobalDocShell ) )
+ if( GetDoc()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) && !ISA( SwGlobalDocShell ) )
{
// This is to set the correct class id if SaveAs is
// called from SwDoc::SplitDoc to save a normal doc as
@@ -808,10 +805,10 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium )
// --> OD 2006-03-17 #i62875#
// reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible
if ( pWrtShell && pDoc &&
- pDoc->DoNotCaptureDrawObjsOnPage() &&
+ pDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
docfunc::AllDrawObjsOnPage( *pDoc ) )
{
- pDoc->SetDoNotCaptureDrawObjsOnPage( false );
+ pDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
}
// <--
@@ -843,15 +840,15 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium )
nSaveType = 2;
// Flags am Dokument entsprechend umsetzen
- BOOL bIsHTMLModeSave = GetDoc()->IsHTMLMode();
- BOOL bIsGlobalDocSave = GetDoc()->IsGlobalDoc();
- BOOL bIsGlblDocSaveLinksSave = GetDoc()->IsGlblDocSaveLinks();
+ BOOL bIsHTMLModeSave = GetDoc()->get(IDocumentSettingAccess::HTML_MODE);
+ BOOL bIsGlobalDocSave = GetDoc()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT);
+ BOOL bIsGlblDocSaveLinksSave = GetDoc()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS);
if( nMyType != nSaveType )
{
- GetDoc()->SetHTMLMode( 1 == nSaveType );
- GetDoc()->SetGlobalDoc( 2 == nSaveType );
+ GetDoc()->set(IDocumentSettingAccess::HTML_MODE, 1 == nSaveType);
+ GetDoc()->set(IDocumentSettingAccess::GLOBAL_DOCUMENT, 2 == nSaveType);
if( 2 != nSaveType )
- GetDoc()->SetGlblDocSaveLinks( FALSE );
+ GetDoc()->set(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS, false);
}
// if the target format is storage based, then the output storage must be already created
@@ -876,9 +873,9 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium )
if( nMyType != nSaveType )
{
- GetDoc()->SetHTMLMode( bIsHTMLModeSave );
- GetDoc()->SetGlobalDoc( bIsGlobalDocSave );
- GetDoc()->SetGlblDocSaveLinks( bIsGlblDocSaveLinksSave );
+ GetDoc()->set(IDocumentSettingAccess::HTML_MODE, bIsHTMLModeSave );
+ GetDoc()->set(IDocumentSettingAccess::GLOBAL_DOCUMENT, bIsGlobalDocSave);
+ GetDoc()->set(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS, bIsGlblDocSaveLinksSave);
}
if( bRet && nMyType != nSaveType )
@@ -1036,10 +1033,10 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup,
JobSetup *pOrig = 0;
if ( rSetup.GetPrinterName().Len() && ASPECT_THUMBNAIL != nAspect )
{
- JobSetup* pOrig = (JobSetup*)pDoc->GetJobsetup();
+ JobSetup* pOrig = const_cast<JobSetup*>(pDoc->getJobsetup());
if( pOrig ) // dann kopieren wir uns den
pOrig = new JobSetup( *pOrig );
- pDoc->SetJobsetup( rSetup );
+ pDoc->setJobsetup( rSetup );
}
Rectangle aRect( nAspect == ASPECT_THUMBNAIL ?
@@ -1056,7 +1053,7 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup,
if( pOrig )
{
- pDoc->SetJobsetup( *pOrig );
+ pDoc->setJobsetup( *pOrig );
delete pOrig;
}
if ( bResetModified )
@@ -1112,7 +1109,7 @@ Rectangle SwDocShell::GetVisArea( USHORT nAspect ) const
if ( pFmt->GetFrmSize().GetWidth() == LONG_MAX )
//Jetzt wird es aber Zeit fuer die Initialisierung
- pDoc->GetPrt( TRUE );
+ pDoc->getPrinter( true );
const SwFmtFrmSize& rFrmSz = pFmt->GetFrmSize();
const Size aSz( rFrmSz.GetWidth(), rFrmSz.GetHeight() );
@@ -1125,20 +1122,20 @@ Rectangle SwDocShell::GetVisArea( USHORT nAspect ) const
Printer *SwDocShell::GetDocumentPrinter()
{
- return pDoc->GetPrt();
+ return pDoc->getPrinter( false );
}
OutputDevice* SwDocShell::GetDocumentRefDev()
{
- return pDoc->_GetRefDev();
+ return pDoc->getReferenceDevice( false );
}
void SwDocShell::OnDocumentPrinterChanged( Printer * pNewPrinter )
{
if ( pNewPrinter )
- GetDoc()->SetJobsetup( pNewPrinter->GetJobSetup() );
+ GetDoc()->setJobsetup( pNewPrinter->GetJobSetup() );
else
- GetDoc()->SetPrt( 0 );
+ GetDoc()->setPrinter( 0, true, true );
}
ULONG SwDocShell::GetMiscStatus() const
@@ -1216,8 +1213,7 @@ void SwDocShell::GetState(SfxItemSet& rSet)
while (pTmpFrm) // Preview suchen
{
if ( PTR_CAST(SwView, pTmpFrm->GetViewShell()) &&
- ((SwView*)pTmpFrm->GetViewShell())->GetWrtShell().
- GetDoc()->IsBrowseMode())
+ ((SwView*)pTmpFrm->GetViewShell())->GetWrtShell().getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE))
{
bDisable = TRUE;
break;
@@ -1278,7 +1274,7 @@ void SwDocShell::GetState(SfxItemSet& rSet)
rSet.DisableItem( nWhich );
else
{
- sal_Bool bState = GetDoc()->IsBrowseMode();
+ sal_Bool bState = GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE);
if(FN_PRINT_LAYOUT == nWhich)
bState = !bState;
rSet.Put( SfxBoolItem( nWhich, bState));