summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2011-01-28 11:44:02 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2011-01-28 11:44:02 +0100
commit4ba03a461e6dae4d182fc7f6b94e781922881caa (patch)
treef88767becc927b2d8fa7b05f9ec4218660b82496 /sfx2/source
parent6797ce4a0ee33c311885b55d73747575639a1055 (diff)
parentd646413d464dc5d6518f87daa8538cd0c600797f (diff)
undoapi: pulled and merged DEV300.m98
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/appl/app.cxx2
-rw-r--r--sfx2/source/appl/appmain.cxx15
-rw-r--r--sfx2/source/config/config.hrc41
-rw-r--r--sfx2/source/config/config.src35
-rw-r--r--sfx2/source/config/evntconf.cxx3
-rw-r--r--sfx2/source/doc/doctempl.cxx4
-rw-r--r--sfx2/source/doc/docvor.cxx18
-rw-r--r--sfx2/source/doc/objcont.cxx50
-rw-r--r--sfx2/source/doc/objxtor.cxx25
-rwxr-xr-xsfx2/source/doc/printhelper.cxx82
-rw-r--r--sfx2/source/view/frmload.cxx40
-rw-r--r--sfx2/source/view/printer.cxx314
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx10
-rw-r--r--sfx2/source/view/viewprn.cxx155
14 files changed, 42 insertions, 752 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 2ff43f893de3..303586762ac2 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -377,6 +377,8 @@ SfxApplication::SfxApplication()
SfxApplication::~SfxApplication()
{
+ OSL_ENSURE( GetObjectShells_Impl().Count() == 0, "Memory leak: some object shells were not removed!" );
+
Broadcast( SfxSimpleHint(SFX_HINT_DYING) );
SfxModule::DestroyModules_Impl();
diff --git a/sfx2/source/appl/appmain.cxx b/sfx2/source/appl/appmain.cxx
index 546b6b1c6558..1bde50fec224 100644
--- a/sfx2/source/appl/appmain.cxx
+++ b/sfx2/source/appl/appmain.cxx
@@ -116,21 +116,6 @@ void SfxApplication::Init
<SfxApplication::OpenClients()>
*/
{
-#ifdef DDE_AVAILABLE
-#ifndef DBG_UTIL
- InitializeDde();
-#else
- if( !InitializeDde() )
- {
- ByteString aStr( "Kein DDE-Service moeglich. Fehler: " );
- if( GetDdeService() )
- aStr += GetDdeService()->GetError();
- else
- aStr += '?';
- DBG_ASSERT( sal_False, aStr.GetBuffer() )
- }
-#endif
-#endif
}
//--------------------------------------------------------------------
diff --git a/sfx2/source/config/config.hrc b/sfx2/source/config/config.hrc
deleted file mode 100644
index 582a2972f913..000000000000
--- a/sfx2/source/config/config.hrc
+++ /dev/null
@@ -1,41 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SFX_CONFIG_HRC
-#define _SFX_CONFIG_HRC
-
-#include <sfx2/sfx.hrc>
-
-// #defines *****************************************************************
-
-#define BTN_OK 2
-#define BTN_CANCEL 3
-#define FT_OK 4
-#define FT_CANCEL 5
-
-#endif
-
diff --git a/sfx2/source/config/config.src b/sfx2/source/config/config.src
deleted file mode 100644
index cb3259e09ad0..000000000000
--- a/sfx2/source/config/config.src
+++ /dev/null
@@ -1,35 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-//#include "config.hrc"
-//#include "sfxlocal.hrc"
-#include <sfx2/sfx.hrc>
-
-String STR_FILTERNAME_CFG
-{
- Text [ en-US ] = "Configuration" ;
-};
diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx
index f2f3b5c50dcb..2ab7b1c9602b 100644
--- a/sfx2/source/config/evntconf.cxx
+++ b/sfx2/source/config/evntconf.cxx
@@ -34,7 +34,7 @@
#include <basic/sbmod.hxx>
#include <tools/urlobj.hxx>
#include <basic/sbx.hxx>
- #include <sot/storage.hxx>
+#include <sot/storage.hxx>
#include <unotools/securityoptions.hxx>
#include <rtl/ustring.h>
@@ -47,7 +47,6 @@
#include <sfx2/app.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/dispatch.hxx>
-#include "config.hrc"
#include "sfx2/sfxresid.hxx"
#include "eventsupplier.hxx"
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index f5ea04e5e08d..f962542aac10 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -137,7 +137,11 @@ namespace DocTempl {
class DocTempl_EntryData_Impl
{
RegionData_Impl* mpParent;
+
+ // the following member must be SfxObjectShellLock since it controlls that SfxObjectShell lifetime by design
+ // and users of this class expect it to be so.
SfxObjectShellLock mxObjShell;
+
OUString maTitle;
OUString maOwnURL;
OUString maTargetURL;
diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx
index 6367f2a65d76..c017a5779cdd 100644
--- a/sfx2/source/doc/docvor.cxx
+++ b/sfx2/source/doc/docvor.cxx
@@ -546,6 +546,9 @@ BOOL SfxOrganizeListBox_Impl::Select( SvLBoxEntry* pEntry, BOOL bSelect )
return SvTreeListBox::Select(pEntry,bSelect);
Path aPath(this, pEntry);
+
+ // it is ok to use the SfxObjectShellRef here since the object that
+ // provides it ( GetObjectShell() calls CreateObjectShell() ) has a lock on it
GetObjectShell(aPath)->TriggerHelpPI(
aPath[nLevel+1], aPath[nLevel+2], aPath[nLevel+3]);
return SvTreeListBox::Select(pEntry,bSelect);
@@ -691,10 +694,12 @@ BOOL SfxOrganizeListBox_Impl::MoveOrCopyContents(SvLBox *pSourceBox,
BOOL bRemovedFromSource = FALSE;
Path aSource(pSourceBox, pSource);
Path aTarget(this, pTarget);
- SfxObjectShellRef aSourceDoc =
- ((SfxOrganizeListBox_Impl *)pSourceBox)->GetObjectShell(aSource);
+ // it is ok to use the SfxObjectShellRef here since the object that
+ // provides it ( GetObjectShell() calls CreateObjectShell() ) has a lock on it
+ SfxObjectShellRef aSourceDoc = ((SfxOrganizeListBox_Impl *)pSourceBox)->GetObjectShell(aSource);
SfxObjectShellRef aTargetDoc = GetObjectShell(aTarget);
+
const USHORT nSLevel =
((SfxOrganizeListBox_Impl *)pSourceBox)->GetDocLevel();
const USHORT nTLevel = GetDocLevel();
@@ -1210,6 +1215,9 @@ void SfxOrganizeListBox_Impl::RequestingChilds( SvLBoxEntry* pEntry )
{
const USHORT nDocLevel = GetDocLevel();
Path aPath(this, pEntry);
+
+ // it is ok to use the SfxObjectShellRef here since the object that
+ // provides it ( GetObjectShell() calls CreateObjectShell() ) has a lock on it
SfxObjectShellRef aRef = GetObjectShell(aPath);
if(aRef.Is())
{
@@ -1887,6 +1895,9 @@ long SfxOrganizeDlg_Impl::Dispatch_Impl( USHORT nId, Menu* _pMenu )
if(!QueryDelete_Impl(pDialog, STR_DELETE_TEMPLATE, pFocusBox->GetEntryText(pEntry)))
return 1;
Path aPath(pFocusBox, pEntry);
+
+ // it is ok to use the SfxObjectShellRef here since the object that
+ // provides it ( GetObjectShell() calls CreateObjectShell() ) has a lock on it
SfxObjectShellRef aRef = pFocusBox->GetObjectShell(aPath);
if(aRef.Is() &&
aRef->Remove(aPath[1+pFocusBox->GetDocLevel()],
@@ -1953,6 +1964,9 @@ long SfxOrganizeDlg_Impl::Dispatch_Impl( USHORT nId, Menu* _pMenu )
if ( !pEntry )
return 1;
Path aPath( pFocusBox, pEntry );
+
+ // it is ok to use the SfxObjectShellRef here since the object that
+ // provides it ( GetObjectShell() calls CreateObjectShell() ) has a lock on it
SfxObjectShellRef aRef = pFocusBox->GetObjectShell( aPath );
if ( aRef.Is() )
{
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 91f5842c1fb7..4aea842e44e9 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -1088,60 +1088,10 @@ void SfxObjectShell::UpdateFromTemplate_Impl( )
//REPLACE pInfo->Save(xDocStor);
}
}
-/*
- SfxConfigManager *pCfgMgr = SFX_CFGMANAGER();
- {
- SfxConfigManager *pTemplCfg = new SfxConfigManager(aTemplStor, pCfgMgr);
- SetConfigManager(pTemplCfg);
- SetTemplateConfig(TRUE);
-
- // Falls der gerade zerst"orte CfgMgr des Dokuments der
- // aktive war, pCfgMgr lieber neu holen
- pCfgMgr = SFX_CFGMANAGER();
-
- // ggf. den neuen ConfigManager aktivieren
- if ( this == SfxObjectShell::Current() )
- pTemplCfg->Activate(pCfgMgr);
- }
-*/
- // Template und Template-DocInfo werden nicht mehr gebraucht
-// delete pTemplInfo;
}
}
}
-SfxObjectShellRef MakeObjectShellForOrganizer_Impl( const String& aTargetURL, BOOL bForWriting )
-{
- // check for own format
- SfxObjectShellRef xDoc;
- StreamMode nMode = bForWriting ? SFX_STREAM_READWRITE : SFX_STREAM_READONLY;
- SfxMedium *pMed = new SfxMedium( aTargetURL, nMode, FALSE, 0 );
- const SfxFilter* pFilter = NULL;
- pMed->UseInteractionHandler(TRUE);
- if( SFX_APP()->GetFilterMatcher().GuessFilter( *pMed, &pFilter ) == ERRCODE_NONE && pFilter && pFilter->IsOwnFormat() )
- {
- // create document
- xDoc = SfxObjectShell::CreateObject( pFilter->GetServiceName(), SFX_CREATE_MODE_ORGANIZER );
- if ( xDoc.Is() )
- {
- // partially load, so don't use DoLoad!
- xDoc->DoInitNew(0);
- // TODO/LATER: make sure that we don't use binary templates!
- if( xDoc->LoadFrom( *pMed ) )
- {
- // connect to storage, abandon temp. storage
- xDoc->DoSaveCompleted( pMed );
- }
- else
- xDoc.Clear();
- }
- }
- else
- delete pMed;
-
- return xDoc;
-}
-
sal_Bool SfxObjectShell::IsHelpDocument() const
{
const SfxFilter* pFilter = GetMedium()->GetFilter();
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 693911f0404c..a5141662fa3d 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -172,12 +172,7 @@ void SAL_CALL SfxModelListener_Impl::disposing( const com::sun::star::lang::Even
SfxObjectShell::SetCurrentComponent( Reference< XInterface >() );
}
- if ( mpDoc->Get_Impl()->bHiddenLockedByAPI )
- {
- mpDoc->Get_Impl()->bHiddenLockedByAPI = FALSE;
- mpDoc->OwnerLock(FALSE);
- }
- else if ( !mpDoc->Get_Impl()->bClosing )
+ if ( !mpDoc->Get_Impl()->bClosing )
// GCC stuerzt ab, wenn schon im dtor, also vorher Flag abfragen
mpDoc->DoClose();
}
@@ -835,22 +830,6 @@ void SfxObjectShell::InitBasicManager_Impl()
}
//--------------------------------------------------------------------
-#if 0 //(mba)
-SotObjectRef SfxObjectShell::CreateAggObj( const SotFactory* pFact )
-{
- // SvDispatch?
- SotFactory* pDispFact = SvDispatch::ClassFactory();
- if( pFact == pDispFact )
- return( (SfxShellObject*)GetSbxObject() );
-
- // sonst unbekannte Aggregation
- DBG_ERROR("unkekannte Factory");
- SotObjectRef aSvObjectRef;
- return aSvObjectRef;
-}
-#endif
-
-//--------------------------------------------------------------------
sal_uInt16 SfxObjectShell::Count()
{
@@ -873,7 +852,7 @@ SfxObjectShell* SfxObjectShell::GetObjectShell()
//--------------------------------------------------------------------
-SEQUENCE< OUSTRING > SfxObjectShell::GetEventNames()
+uno::Sequence< ::rtl::OUString > SfxObjectShell::GetEventNames()
{
static uno::Sequence< ::rtl::OUString >* pEventNameContainer = NULL;
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index 2cd195976832..d088f6981f49 100755
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -53,7 +53,6 @@
#include <ucbhelper/content.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <vos/mutex.hxx>
-#include <svtools/printdlg.hxx>
#include <cppuhelper/implbase1.hxx>
#include <sfx2/viewfrm.hxx>
@@ -345,7 +344,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue >
// Name-Property?
if ( rProp.Name.compareToAscii( "Name" ) == 0 )
{
- OUSTRING sTemp;
+ ::rtl::OUString sTemp;
if ( ( rProp.Value >>= sTemp ) == sal_False )
throw ::com::sun::star::lang::IllegalArgumentException();
@@ -619,9 +618,9 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
if ( rProp.Name.compareToAscii( "FileName" ) == 0 )
{
// unpack th URL and check for a valid and well known protocol
- OUSTRING sTemp;
+ ::rtl::OUString sTemp;
if (
- ( rProp.Value.getValueType()!=::getCppuType((const OUSTRING*)0)) ||
+ ( rProp.Value.getValueType()!=::getCppuType((const ::rtl::OUString*)0)) ||
(!(rProp.Value>>=sTemp))
)
{
@@ -718,7 +717,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
// Pages-Property
else if ( rProp.Name.compareToAscii( "Pages" ) == 0 )
{
- OUSTRING sTemp;
+ ::rtl::OUString sTemp;
if( rProp.Value >>= sTemp )
{
aCheckedArgs[nProps].Name = rProp.Name;
@@ -799,81 +798,8 @@ void IMPL_PrintListener_DataContainer::Notify( SfxBroadcaster& rBC, const SfxHin
{
if ( !m_xPrintJob.is() )
m_xPrintJob = new SfxPrintJob_Impl( this );
-/*
- PrintDialog* pDlg = pPrintHint->GetPrintDialog();
- Printer* pPrinter = pPrintHint->GetPrinter();
- ::rtl::OUString aPrintFile ( ( pPrinter && pPrinter->IsPrintFileEnabled() ) ? pPrinter->GetPrintFile() : String() );
- ::rtl::OUString aRangeText ( ( pDlg && pDlg->IsRangeChecked(PRINTDIALOG_RANGE) ) ? pDlg->GetRangeText() : String() );
- sal_Bool bSelectionOnly = ( ( pDlg && pDlg->IsRangeChecked(PRINTDIALOG_SELECTION) ) ? sal_True : sal_False );
-
- sal_Int32 nArgs = 2;
- if ( aPrintFile.getLength() )
- nArgs++;
- if ( aRangeText.getLength() )
- nArgs++;
- else if ( bSelectionOnly )
- nArgs++;
-
- m_aPrintOptions.realloc(nArgs);
- m_aPrintOptions[0].Name = DEFINE_CONST_UNICODE("CopyCount");
- m_aPrintOptions[0].Value <<= (sal_Int16) (pPrinter ? pPrinter->GetCopyCount() : 1 );
- m_aPrintOptions[1].Name = DEFINE_CONST_UNICODE("Collate");
- m_aPrintOptions[1].Value <<= (sal_Bool) (pDlg ? pDlg->IsCollateChecked() : sal_False );
-
- if ( bSelectionOnly )
- {
- m_aPrintOptions[2].Name = DEFINE_CONST_UNICODE("Selection");
- m_aPrintOptions[2].Value <<= bSelectionOnly;
- }
- else if ( aRangeText.getLength() )
- {
- m_aPrintOptions[2].Name = DEFINE_CONST_UNICODE("Pages");
- m_aPrintOptions[2].Value <<= aRangeText;
- }
-
- if ( aPrintFile.getLength() )
- {
- m_aPrintOptions[nArgs-1].Name = DEFINE_CONST_UNICODE("FileName");
- m_aPrintOptions[nArgs-1].Value <<= aPrintFile;
- }
-*/
m_aPrintOptions = pPrintHint->GetOptions();
}
-/*
- else if ( pPrintHint->GetWhich() == -3 ) // -3 : AdditionalPrintOptions
- {
- uno::Sequence < beans::PropertyValue >& lOldOpts = m_aPrintOptions;
- const uno::Sequence < beans::PropertyValue >& lNewOpts = pPrintHint->GetAdditionalOptions();
- sal_Int32 nOld = lOldOpts.getLength();
- sal_Int32 nAdd = lNewOpts.getLength();
- lOldOpts.realloc( nOld + nAdd );
-
- // assume that all new elements are overwriting old ones and so don't need to be added
- sal_Int32 nTotal = nOld;
- for ( sal_Int32 n=0; n<nAdd; n++ )
- {
- sal_Int32 m;
- for ( m=0; m<nOld; m++ )
- if ( lNewOpts[n].Name == lOldOpts[m].Name )
- // new option overwrites old one
- break;
-
- if ( m == nOld )
- {
- // this is a new option, so add it to the resulting sequence - counter must be incremented
- lOldOpts[nTotal].Name = lNewOpts[n].Name;
- lOldOpts[nTotal++].Value = lNewOpts[n].Value;
- }
- else
- // overwrite old option with new value, counter stays unmodified
- lOldOpts[m].Value = lNewOpts[n].Value;
- }
-
- if ( nTotal != lOldOpts.getLength() )
- // at least one new options has overwritten an old one, so we allocated too much
- lOldOpts.realloc( nTotal );
- }
-*/
else if ( pPrintHint->GetWhich() != -2 ) // -2 : CancelPrintJob
{
view::PrintJobEvent aEvent;
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index a4707f03d364..4dbb8a3c640e 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -263,25 +263,6 @@ sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const USHORT _nSlo
}
// --------------------------------------------------------------------------------------------------------------------
-void SfxFrameLoader_Impl::impl_lockHiddenDocument( SfxObjectShell& i_rDocument, const ::comphelper::NamedValueCollection& i_rDescriptor ) const
-{
- const sal_Bool bHidden = i_rDescriptor.getOrDefault( "Hidden", sal_False );
- if ( !bHidden )
- return;
-
- const SfxViewFrame* pExistingViewFrame = SfxViewFrame::GetFirst( &i_rDocument );
- if ( pExistingViewFrame )
- return;
-
- // the document is to be loaded hidden, and it is not yet displayed in any other frame
- // To prevent it from being closed when the loader returns, increase its OwnerLock
- // (the OwnerLock is normally increased by every frame in which the document is displayed, and by this loader)
- i_rDocument.RestoreNoDelete();
- i_rDocument.OwnerLock( TRUE );
- i_rDocument.Get_Impl()->bHiddenLockedByAPI = TRUE;
-}
-
-// --------------------------------------------------------------------------------------------------------------------
void SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedValueCollection& io_rDescriptor ) const
{
const ::rtl::OUString sURL = io_rDescriptor.getOrDefault( "URL", ::rtl::OUString() );
@@ -331,7 +312,7 @@ void SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedValueCollecti
}
// --------------------------------------------------------------------------------------------------------------------
-SfxObjectShellLock SfxFrameLoader_Impl::impl_findObjectShell( const Reference< XModel2 >& i_rxDocument ) const
+SfxObjectShellRef SfxFrameLoader_Impl::impl_findObjectShell( const Reference< XModel2 >& i_rxDocument ) const
{
for ( SfxObjectShell* pDoc = SfxObjectShell::GetFirst( NULL, FALSE ); pDoc; pDoc = SfxObjectShell::GetNext( *pDoc, NULL, FALSE ) )
{
@@ -635,15 +616,12 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA
// tell the doc its (current) load args.
impl_removeLoaderArguments( aDescriptor );
xModel->attachResource( xModel->getURL(), aDescriptor.getPropertyValues() );
- // TODO: not sure this is correct. The original, pre-refactoring code did it this way. However, I could
- // imagine scenarios where it is *not* correct to overrule the *existing* model args (XModel::getArgs)
- // with the ones passed to the loader here. For instance, what about the MacroExecutionMode? The document
- // might have a mode other than the one passed to the loader, and we always overwrite the former with
- // the latter.
}
// get the SfxObjectShell (still needed at the moment)
- const SfxObjectShellLock xDoc = impl_findObjectShell( xModel );
+ // SfxObjectShellRef is used here ( instead of ...Lock ) since the model is closed below if necessary
+ // SfxObjectShellLock would be even dangerous here, since the lifetime control should be done outside in case of success
+ const SfxObjectShellRef xDoc = impl_findObjectShell( xModel );
ENSURE_OR_THROW( xDoc.Is(), "no SfxObjectShell for the given model" );
// ensure the ID of the to-be-created view is in the descriptor, if possible
@@ -651,16 +629,6 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA
const sal_Int16 nViewNo = xDoc->GetFactory().GetViewNo_Impl( nViewId, 0 );
const ::rtl::OUString sViewName( xDoc->GetFactory().GetViewFactory( nViewNo ).GetAPIViewName() );
- // if the document is created hidden, prevent it from being deleted until it is shown or disposed
- impl_lockHiddenDocument( *xDoc, aDescriptor );
- // TODO; if we wouldn't use a SfxObjectShellLock instance for xDoc, but a simple SfxObjectShellRef,
- // then this would not be necessary, /me thinks. That is, the *Lock classes inc/dec a "Lock" counter
- // (additional to the ref counter) in their ctor/dtor, and if the lock counter goes to 0, the
- // object is closed (DoClose). The impl_lockHiddenDocument is to prevent exactly that premature
- // closing. However, a *Ref object wouldn't close, anyway. And in case of unsuccessfull loading, the
- // code at the very end of this method cares for closing the XModel, which should also close the
- // ObjectShell.
-
// plug the document into the frame
impl_createDocumentView( xModel, _rTargetFrame, aViewCreationArgs, sViewName );
bLoadSuccess = sal_True;
diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx
index 310c1a58a578..64bebccd60fd 100644
--- a/sfx2/source/view/printer.cxx
+++ b/sfx2/source/view/printer.cxx
@@ -30,7 +30,6 @@
#include <vcl/virdev.hxx>
#include <vcl/metric.hxx>
#include <vcl/msgbox.hxx>
-#include <svtools/printdlg.hxx>
#include <unotools/printwarningoptions.hxx>
#include <svtools/printoptions.hxx>
#include <vector>
@@ -47,54 +46,23 @@
#include "sfx2/sfxresid.hxx"
#include "view.hrc"
-#ifdef MSC
-// der ist buggy
-#define NEW_OBJECTS(Class, nCount) ((Class*) new char[ sizeof(Class) * (nCount) ])
-#else
-#define NEW_OBJECTS(Class, nCount) (new Class[nCount])
-#endif
-
-
-USHORT SfxFontSizeInfo::pStaticSizes[] =
-{
- 60,
- 80,
- 100,
- 120,
- 140,
- 180,
- 240,
- 360,
- 480,
- 600,
- 720
-};
-
-//--------------------------------------------------------------------
-
-SV_DECL_PTRARR_DEL(SfxFontArr_Impl,SfxFont*,10,5)
-
// struct SfxPrinter_Impl ------------------------------------------------
struct SfxPrinter_Impl
{
- SfxFontArr_Impl* mpFonts;
BOOL mbAll;
BOOL mbSelection;
BOOL mbFromTo;
BOOL mbRange;
SfxPrinter_Impl() :
- mpFonts ( NULL ),
mbAll ( TRUE ),
mbSelection ( TRUE ),
mbFromTo ( TRUE ),
mbRange ( TRUE ) {}
- ~SfxPrinter_Impl() { delete mpFonts; }
+ ~SfxPrinter_Impl() {}
};
-#define FONTS() pImpl->mpFonts
-
struct SfxPrintOptDlg_Impl
{
sal_Bool mbHelpDisabled;
@@ -103,98 +71,6 @@ struct SfxPrintOptDlg_Impl
mbHelpDisabled ( sal_False ) {}
};
-//--------------------------------------------------------------------
-
-SfxFontSizeInfo::SfxFontSizeInfo( const SfxFont &rFont,
- const OutputDevice &rDevice ) :
-
- pSizes(0),
- nSizes(0),
- bScalable(TRUE)
-
-{
- if ( 0 == rDevice.GetDevFontCount() )
- bScalable = FALSE;
- else
- {
- OutputDevice &rDev = (OutputDevice&) rDevice;
- Font aFont(rFont.GetName(), Size(0,12));
- aFont.SetFamily(rFont.GetFamily());
- aFont.SetPitch(rFont.GetPitch());
- aFont.SetCharSet(rFont.GetCharSet());
-
- // verfuegbare Groessen in die Liste eintragen, Groesse in 10tel Punkt
- int nSizeCount = rDev.GetDevFontSizeCount(aFont);
- pSizes = NEW_OBJECTS(Size, nSizeCount);
- const MapMode aOldMapMode = rDev.GetMapMode();
- MapMode aMap(aOldMapMode);
- aMap.SetMapUnit(MAP_POINT);
- const Fraction aTen(1, 10);
- aMap.SetScaleX(aTen);
- aMap.SetScaleY(aTen);
- rDev.SetMapMode(aMap);
-
- // Es gibt Fonts mit Bitmaps und skalierbaren Groessen
- // In diesem Fall wird der Fonts als skalierbar behandelt.
- BOOL bFoundScalable = FALSE;
- for ( int i = 0; i < nSizeCount; ++i )
- {
- const Size aSize( rDev.GetDevFontSize(aFont, i) );
- if ( aSize.Height() != 0 )
- pSizes[nSizes++] = aSize;
- else
- bFoundScalable |= TRUE;
- }
- if( !bFoundScalable )
- bScalable = FALSE;
- else
- {
- // statische Font-Sizes verwenden
- delete [] pSizes;
- nSizes = 0;
- }
- rDev.SetMapMode(aOldMapMode);
- }
-
- if ( 0 == nSizes )
- {
- nSizes = sizeof(pStaticSizes) / sizeof(USHORT);
- pSizes = NEW_OBJECTS(Size, nSizes);
- for ( USHORT nPos = 0; nPos <nSizes; ++nPos )
- pSizes[nPos] = Size( 0, pStaticSizes[nPos] );
- }
-}
-
-//--------------------------------------------------------------------
-
-SfxFontSizeInfo::~SfxFontSizeInfo()
-{
- delete [] pSizes;
-}
-
-//--------------------------------------------------------------------
-
-BOOL SfxFontSizeInfo::HasSize(const Size &rSize) const
-{
- if ( bScalable )
- return TRUE;
- for ( USHORT i = 0; i < nSizes; ++i)
- if ( pSizes[i] == rSize )
- return TRUE;
- return FALSE;
-}
-
-//--------------------------------------------------------------------
-
-SfxFont::SfxFont( const FontFamily eFontFamily, const String& aFontName,
- const FontPitch eFontPitch, const CharSet eFontCharSet ):
- aName( aFontName ),
- eFamily( eFontFamily ),
- ePitch( eFontPitch ),
- eCharSet( eFontCharSet )
-{
-}
-
// class SfxPrinter ------------------------------------------------------
SfxPrinter* SfxPrinter::Create( SvStream& rStream, SfxItemSet* pOptions )
@@ -335,194 +211,6 @@ void SfxPrinter::SetOptions( const SfxItemSet &rNewOptions )
//--------------------------------------------------------------------
-void SfxPrinter::EnableRange( USHORT nRange )
-{
- PrintDialogRange eRange = (PrintDialogRange)nRange;
-
- if ( eRange == PRINTDIALOG_ALL )
- pImpl->mbAll = TRUE;
- else if ( eRange == PRINTDIALOG_SELECTION )
- pImpl->mbSelection = TRUE;
- else if ( eRange == PRINTDIALOG_FROMTO )
- pImpl->mbFromTo = TRUE;
- else if ( eRange == PRINTDIALOG_RANGE )
- pImpl->mbRange = TRUE;
-}
-
-//--------------------------------------------------------------------
-
-void SfxPrinter::DisableRange( USHORT nRange )
-{
- PrintDialogRange eRange = (PrintDialogRange)nRange;
-
- if ( eRange == PRINTDIALOG_ALL )
- pImpl->mbAll = FALSE;
- else if ( eRange == PRINTDIALOG_SELECTION )
- pImpl->mbSelection = FALSE;
- else if ( eRange == PRINTDIALOG_FROMTO )
- pImpl->mbFromTo = FALSE;
- else if ( eRange == PRINTDIALOG_RANGE )
- pImpl->mbRange = FALSE;
-}
-
-//--------------------------------------------------------------------
-
-BOOL SfxPrinter::IsRangeEnabled( USHORT nRange ) const
-{
- PrintDialogRange eRange = (PrintDialogRange)nRange;
- BOOL bRet = FALSE;
-
- if ( eRange == PRINTDIALOG_ALL )
- bRet = pImpl->mbAll;
- else if ( eRange == PRINTDIALOG_SELECTION )
- bRet = pImpl->mbSelection;
- else if ( eRange == PRINTDIALOG_FROMTO )
- bRet = pImpl->mbFromTo;
- else if ( eRange == PRINTDIALOG_RANGE )
- bRet = pImpl->mbRange;
-
- return bRet;
-}
-
-//--------------------------------------------------------------------
-
-SV_IMPL_PTRARR(SfxFontArr_Impl,SfxFont*)
-
-//--------------------------------------------------------------------
-
-const SfxFont* SfxFindFont_Impl( const SfxFontArr_Impl& rArr,
- const String& rName )
-{
- const USHORT nCount = rArr.Count();
- for ( USHORT i = 0; i < nCount; ++i )
- {
- const SfxFont *pFont = rArr[i];
- if ( pFont->GetName() == rName )
- return pFont;
- }
- return NULL;
-}
-
-//--------------------------------------------------------------------
-
-void SfxPrinter::UpdateFonts_Impl()
-{
- VirtualDevice *pVirDev = 0;
- const OutputDevice *pOut = this;
-
- // falls kein Drucker gefunden werden konnte, ein
- // temp. Device erzeugen fuer das Erfragen der Fonts
- if( !IsValid() )
- pOut = pVirDev = new VirtualDevice;
-
- int nCount = pOut->GetDevFontCount();
- FONTS() = new SfxFontArr_Impl((BYTE)nCount);
-
- std::vector< Font > aNonRegularFonts;
- for(int i = 0;i < nCount;++i)
- {
- Font aFont(pOut->GetDevFont(i));
- if ( (aFont.GetItalic() != ITALIC_NONE) ||
- (aFont.GetWeight() != WEIGHT_MEDIUM) )
- {
- // First: Don't add non-regular fonts. The font name is not unique so we have
- // to filter the device font list.
- aNonRegularFonts.push_back( aFont );
- }
- else if ( FONTS()->Count() == 0 ||
- (*FONTS())[FONTS()->Count()-1]->GetName() != aFont.GetName() )
- {
- DBG_ASSERT(0 == SfxFindFont_Impl(*FONTS(), aFont.GetName()), "Doppelte Fonts vom SV-Device!");
- SfxFont* pTmp = new SfxFont( aFont.GetFamily(), aFont.GetName(),
- aFont.GetPitch(), aFont.GetCharSet() );
- FONTS()->C40_INSERT(SfxFont, pTmp, FONTS()->Count());
- }
- }
- delete pVirDev;
-
- // Try to add all non-regular fonts. It could be that there was no regular font
- // with the same name added.
- std::vector< Font >::const_iterator pIter;
- for ( pIter = aNonRegularFonts.begin(); pIter != aNonRegularFonts.end(); pIter++ )
- {
- if ( SfxFindFont_Impl( *FONTS(), pIter->GetName() ) == 0 )
- {
- SfxFont* pTmp = new SfxFont( pIter->GetFamily(), pIter->GetName(),
- pIter->GetPitch(), pIter->GetCharSet() );
- FONTS()->C40_INSERT( SfxFont, pTmp, FONTS()->Count() );
- }
- }
-}
-
-//--------------------------------------------------------------------
-
-USHORT SfxPrinter::GetFontCount()
-{
- if ( !FONTS() )
- UpdateFonts_Impl();
- return FONTS()->Count();
-}
-
-//--------------------------------------------------------------------
-
-const SfxFont* SfxPrinter::GetFont( USHORT nNo ) const
-{
- DBG_ASSERT( FONTS(), "bitte erst GetFontCount() abfragen!" );
- return (*FONTS())[ nNo ];
-}
-
-//--------------------------------------------------------------------
-
-const SfxFont* SfxPrinter::GetFontByName( const String &rFontName )
-{
- if ( !FONTS() )
- UpdateFonts_Impl();
- return SfxFindFont_Impl(*FONTS(), rFontName);
-}
-
-//--------------------------------------------------------------------
-
-BOOL SfxPrinter::InitJob( Window* pUIParent, BOOL bAskAboutTransparentObjects )
-{
- const SvtPrinterOptions aPrinterOpt;
- const SvtPrintFileOptions aPrintFileOpt;
- const SvtBasePrintOptions* pPrinterOpt = &aPrinterOpt;
- const SvtBasePrintOptions* pPrintFileOpt = &aPrintFileOpt;
- PrinterOptions aNewPrinterOptions;
- BOOL bRet = TRUE;
-
- ( ( IsPrintFileEnabled() && GetPrintFile().Len() ) ? pPrintFileOpt : pPrinterOpt )->GetPrinterOptions( aNewPrinterOptions );
-
- if( bAskAboutTransparentObjects && !aNewPrinterOptions.IsReduceTransparency() )
- {
- if ( !Application::IsHeadlessModeEnabled() )
- {
- SvtPrintWarningOptions aWarnOpt;
-
- if( aWarnOpt.IsTransparency() )
- {
- TransparencyPrintWarningBox aWarnBox( pUIParent );
- const USHORT nRet = aWarnBox.Execute();
-
- if( nRet == RET_CANCEL )
- bRet = FALSE;
- else
- {
- aNewPrinterOptions.SetReduceTransparency( nRet != RET_NO );
- aWarnOpt.SetTransparency( !aWarnBox.IsNoWarningChecked() );
- }
- }
- }
- }
-
- if( bRet )
- SetPrinterOptions( aNewPrinterOptions );
-
- return bRet;
-}
-
-//--------------------------------------------------------------------
-
SfxPrintOptionsDialog::SfxPrintOptionsDialog( Window *pParent,
SfxViewShell *pViewShell,
const SfxItemSet *pSet ) :
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index b8ad1cfc61f7..8fd223279372 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -734,7 +734,7 @@ ANY SfxBaseController::getViewData() throw( ::com::sun::star::uno::RuntimeExcept
if ( m_pData->m_pViewShell )
{
m_pData->m_pViewShell->WriteUserData( sData1 ) ;
- OUSTRING sData( sData1 );
+ ::rtl::OUString sData( sData1 );
aAny <<= sData ;
}
@@ -750,7 +750,7 @@ void SAL_CALL SfxBaseController::restoreViewData( const ANY& aValue ) throw( ::c
::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pData->m_pViewShell )
{
- OUSTRING sData;
+ ::rtl::OUString sData;
aValue >>= sData ;
m_pData->m_pViewShell->ReadUserData( sData ) ;
}
@@ -781,7 +781,7 @@ REFERENCE< XMODEL > SAL_CALL SfxBaseController::getModel() throw( ::com::sun::st
//________________________________________________________________________________________________________
REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL& aURL ,
- const OUSTRING& sTargetFrameName,
+ const ::rtl::OUString& sTargetFrameName,
sal_Int32 eSearchFlags ) throw( RUNTIMEEXCEPTION )
{
::vos::OGuard aGuard( Application::GetSolarMutex() );
@@ -938,12 +938,12 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOU
// SfxBaseController -> XDispatchProvider
//________________________________________________________________________________________________________
-SEQUENCE< REFERENCE< XDISPATCH > > SAL_CALL SfxBaseController::queryDispatches( const SEQUENCE< DISPATCHDESCRIPTOR >& seqDescripts ) throw( ::com::sun::star::uno::RuntimeException )
+uno::Sequence< REFERENCE< XDISPATCH > > SAL_CALL SfxBaseController::queryDispatches( const uno::Sequence< DISPATCHDESCRIPTOR >& seqDescripts ) throw( ::com::sun::star::uno::RuntimeException )
{
// Create return list - which must have same size then the given descriptor
// It's not allowed to pack it!
sal_Int32 nCount = seqDescripts.getLength();
- SEQUENCE< REFERENCE< XDISPATCH > > lDispatcher( nCount );
+ uno::Sequence< REFERENCE< XDISPATCH > > lDispatcher( nCount );
for( sal_Int32 i=0; i<nCount; ++i )
{
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 4ef4244f28e6..24ed85556466 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -34,7 +34,6 @@
#include <svl/itempool.hxx>
#include <vcl/msgbox.hxx>
-#include <svtools/printdlg.hxx>
#include <svtools/prnsetup.hxx>
#include <svl/flagitem.hxx>
#include <svl/stritem.hxx>
@@ -352,30 +351,6 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
}
}
-// -----------------------------------------------------------------------
-
-void DisableRanges( PrintDialog& rDlg, SfxPrinter* pPrinter )
-
-/* [Beschreibung]
-
- Mit dieser Funktion werden die nicht verf"ugbaren Ranges
- vom Printer zum PrintDialog geforwarded.
-*/
-
-{
- if ( !pPrinter )
- return;
-
- if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_ALL ) )
- rDlg.DisableRange( PRINTDIALOG_ALL );
- if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_SELECTION ) )
- rDlg.DisableRange( PRINTDIALOG_SELECTION );
- if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_FROMTO ) )
- rDlg.DisableRange( PRINTDIALOG_FROMTO );
- if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_RANGE ) )
- rDlg.DisableRange( PRINTDIALOG_RANGE );
-}
-
//====================================================================
class SfxDialogExecutor_Impl
@@ -392,7 +367,6 @@ class SfxDialogExecutor_Impl
{
private:
SfxViewShell* _pViewSh;
- PrintDialog* _pPrintParent;
PrinterSetupDialog* _pSetupParent;
SfxItemSet* _pOptions;
sal_Bool _bModified;
@@ -401,7 +375,6 @@ private:
DECL_LINK( Execute, void * );
public:
- SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrintDialog* pParent );
SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrinterSetupDialog* pParent );
~SfxDialogExecutor_Impl() { delete _pOptions; }
@@ -412,22 +385,9 @@ public:
//--------------------------------------------------------------------
-SfxDialogExecutor_Impl::SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrintDialog* pParent ) :
-
- _pViewSh ( pViewSh ),
- _pPrintParent ( pParent ),
- _pSetupParent ( NULL ),
- _pOptions ( NULL ),
- _bModified ( sal_False ),
- _bHelpDisabled ( sal_False )
-
-{
-}
-
SfxDialogExecutor_Impl::SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrinterSetupDialog* pParent ) :
_pViewSh ( pViewSh ),
- _pPrintParent ( NULL ),
_pSetupParent ( pParent ),
_pOptions ( NULL ),
_bModified ( sal_False ),
@@ -443,27 +403,13 @@ IMPL_LINK( SfxDialogExecutor_Impl, Execute, void *, EMPTYARG )
// Options lokal merken
if ( !_pOptions )
{
- DBG_ASSERT( _pPrintParent || _pSetupParent, "no dialog parent" );
- if( _pPrintParent )
- _pOptions = ( (SfxPrinter*)_pPrintParent->GetPrinter() )->GetOptions().Clone();
- else if( _pSetupParent )
+ DBG_ASSERT( _pSetupParent, "no dialog parent" );
+ if( _pSetupParent )
_pOptions = ( (SfxPrinter*)_pSetupParent->GetPrinter() )->GetOptions().Clone();
}
- if ( _pOptions && _pPrintParent && _pPrintParent->IsSheetRangeAvailable() )
- {
- SfxItemState eState = _pOptions->GetItemState( SID_PRINT_SELECTEDSHEET );
- if ( eState != SFX_ITEM_UNKNOWN )
- {
- PrintSheetRange eRange = _pPrintParent->GetCheckedSheetRange();
- BOOL bValue = ( PRINTSHEETS_ALL != eRange );
- _pOptions->Put( SfxBoolItem( SID_PRINT_SELECTEDSHEET, bValue ) );
- }
- }
-
// Dialog ausf"uhren
- SfxPrintOptionsDialog* pDlg = new SfxPrintOptionsDialog( _pPrintParent ? static_cast<Window*>(_pPrintParent)
- : static_cast<Window*>(_pSetupParent),
+ SfxPrintOptionsDialog* pDlg = new SfxPrintOptionsDialog( static_cast<Window*>(_pSetupParent),
_pViewSh, _pOptions );
if ( _bHelpDisabled )
pDlg->DisableHelp();
@@ -472,15 +418,6 @@ IMPL_LINK( SfxDialogExecutor_Impl, Execute, void *, EMPTYARG )
delete _pOptions;
_pOptions = pDlg->GetOptions().Clone();
- if ( _pOptions && _pPrintParent && _pPrintParent->IsSheetRangeAvailable() )
- {
- const SfxPoolItem* pItem;
- if ( SFX_ITEM_SET == _pOptions->GetItemState( SID_PRINT_SELECTEDSHEET, FALSE , &pItem ) )
- {
- _pPrintParent->CheckSheetRange( ( (const SfxBoolItem*)pItem )->GetValue()
- ? PRINTSHEETS_SELECTED_SHEETS : PRINTSHEETS_ALL );
- }
- }
}
delete pDlg;
@@ -687,7 +624,6 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
USHORT nDialogRet = RET_CANCEL;
// BOOL bCollate=FALSE;
SfxPrinter* pPrinter = 0;
- PrintDialog* pPrintDlg = 0;
SfxDialogExecutor_Impl* pExecutor = 0;
bool bSilent = false;
BOOL bIsAPI = rReq.GetArgs() && rReq.GetArgs()->Count();
@@ -895,16 +831,12 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
// forget new printer, it was taken over (as pPrinter) or deleted
pDlgPrinter = NULL;
- /* Now lets reset the Dialog printer, since its freed */
- if (pPrintDlg)
- pPrintDlg->SetPrinter (pPrinter);
}
else
{
// PrinterDialog is used to transfer information on printing,
// so it will only be deleted here if dialog was cancelled
DELETEZ( pDlgPrinter );
- DELETEZ( pPrintDlg );
rReq.Ignore();
if ( SID_PRINTDOC == nId )
rReq.SetReturnValue(SfxBoolItem(0,FALSE));
@@ -923,80 +855,6 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
//--------------------------------------------------------------------
-PrintDialog* SfxViewShell::CreatePrintDialog( Window* /*pParent*/ )
-
-/* [Beschreibung]
-
- Diese Methode kann "uberladen werden, um einen speziellen PrintDialog
- zu erzeugen. Dies ist z.B. notwendig wenn spezielle <StarView> Features
- wie drucken von Seitenbereichen.
-*/
-
-{
- #if 0
- PrintDialog *pDlg = new PrintDialog( pParent, false );
- pDlg->SetFirstPage( 1 );
- pDlg->SetLastPage( 9999 );
- pDlg->EnableCollate();
- return pDlg;
- #else
- return NULL;
- #endif
-}
-
-//--------------------------------------------------------------------
-
-void SfxViewShell::PreparePrint( PrintDialog * )
-{
-}
-
-//--------------------------------------------------------------------
-
-
-ErrCode SfxViewShell::DoPrint( SfxPrinter* /*pPrinter*/,
- PrintDialog* /*pPrintDlg*/,
- BOOL /*bSilent*/, BOOL /*bIsAPI*/ )
-{
- #if 0
- // Printer-Dialogbox waehrend des Ausdrucks mu\s schon vor
- // StartJob erzeugt werden, da SV bei einem Quit-Event h"angt
- SfxPrintProgress *pProgress = new SfxPrintProgress( this, !bSilent );
- SfxPrinter *pDocPrinter = GetPrinter(TRUE);
- if ( !pPrinter )
- pPrinter = pDocPrinter;
- else if ( pDocPrinter != pPrinter )
- {
- pProgress->RestoreOnEndPrint( pDocPrinter->Clone() );
- SetPrinter( pPrinter, SFX_PRINTER_PRINTER );
- }
- pProgress->SetWaitMode(FALSE);
-
- // Drucker starten
- PreparePrint( pPrintDlg );
- SfxObjectShell *pObjShell = GetViewFrame()->GetObjectShell();
- if ( pPrinter->StartJob(pObjShell->GetTitle(0)) )
- {
- // Drucken
- Print( *pProgress, bIsAPI, pPrintDlg );
- pProgress->Stop();
- pProgress->DeleteOnEndPrint();
- pPrinter->EndJob();
- }
- else
- {
- // Printer konnte nicht gestartet werden
- delete pProgress;
- }
-
- return pPrinter->GetError();
- #else
- DBG_ERROR( "DoPrint called, dead code !" );
- return ERRCODE_IO_NOTSUPPORTED;
- #endif
-}
-
-//--------------------------------------------------------------------
-
BOOL SfxViewShell::IsPrinterLocked() const
{
return pImp->m_nPrinterLocks > 0;
@@ -1026,13 +884,6 @@ void SfxViewShell::LockPrinter( BOOL bLock)
//--------------------------------------------------------------------
-USHORT SfxViewShell::Print( SfxProgress& /*rProgress*/, BOOL /*bIsAPI*/, PrintDialog* /*pDlg*/ )
-{
- return 0;
-}
-
-//--------------------------------------------------------------------
-
SfxPrinter* SfxViewShell::GetPrinter( BOOL /*bCreate*/ )
{
return 0;