summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2008-10-14 05:23:43 +0000
committerOliver Bolte <obo@openoffice.org>2008-10-14 05:23:43 +0000
commit0a6f995f4e6739636123a9829b5e22ea04b52f72 (patch)
tree65e063a7ebfb79d2f184338c18cc2b66e568a480 /sfx2/source
parentf88f6451fb99709768369d774f6eff35b3715902 (diff)
CWS-TOOLING: integrate CWS mba30fixes02
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/doc/docfile.cxx7
-rw-r--r--sfx2/source/doc/doctemplates.cxx31
-rw-r--r--sfx2/source/doc/objstor.cxx4
-rw-r--r--sfx2/source/view/viewfrm.cxx2
-rw-r--r--sfx2/source/view/viewprn.cxx5
5 files changed, 40 insertions, 9 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index a5cbfd9889..da0dc6e7a0 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: docfile.cxx,v $
- * $Revision: 1.204 $
+ * $Revision: 1.203.50.2 $
*
* This file is part of OpenOffice.org.
*
@@ -3261,8 +3261,9 @@ void SfxMedium::SetStorage_Impl( const uno::Reference < embed::XStorage >& rStor
SfxItemSet* SfxMedium::GetItemSet() const
{
- if( !pSet ) ((SfxMedium*)this)->pSet =
- new SfxAllItemSet( SFX_APP()->GetPool() );
+ // this method *must* return an ItemSet, returning NULL can cause crashes
+ if( !pSet )
+ ((SfxMedium*)this)->pSet = new SfxAllItemSet( SFX_APP()->GetPool() );
return pSet;
}
//----------------------------------------------------------------
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index af244991e7..d3fdef179f 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: doctemplates.cxx,v $
- * $Revision: 1.43 $
+ * $Revision: 1.42.84.2 $
*
* This file is part of OpenOffice.org.
*
@@ -158,6 +158,26 @@ class DocTemplates_EntryData_Impl;
class GroupData_Impl;
//=============================================================================
+#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <com/sun/star/ucb/XProgressHandler.hpp>
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+
+class TplTaskEnvironment : public ::cppu::WeakImplHelper1< ucb::XCommandEnvironment >
+{
+ uno::Reference< task::XInteractionHandler > m_xInteractionHandler;
+ uno::Reference< ucb::XProgressHandler > m_xProgressHandler;
+
+public:
+ TplTaskEnvironment( const uno::Reference< task::XInteractionHandler>& rxInteractionHandler )
+ : m_xInteractionHandler( rxInteractionHandler )
+ {}
+
+ virtual uno::Reference<task::XInteractionHandler> SAL_CALL getInteractionHandler() throw (uno::RuntimeException)
+ { return m_xInteractionHandler; }
+
+ virtual uno::Reference<ucb::XProgressHandler> SAL_CALL getProgressHandler() throw (uno::RuntimeException)
+ { return m_xProgressHandler; }
+};
class SfxDocTplService_Impl
{
@@ -383,6 +403,13 @@ DECLARE_LIST( GroupList_Impl, GroupData_Impl* )
//-----------------------------------------------------------------------------
void SfxDocTplService_Impl::init_Impl()
{
+ uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
+ if ( xFactory.is() )
+ {
+ uno::Reference < task::XInteractionHandler > xInteractionHandler( xFactory->createInstance( DEFINE_CONST_UNICODE("com.sun.star.task.InteractionHandler") ), uno::UNO_QUERY );
+ maCmdEnv = new TplTaskEnvironment( xInteractionHandler );
+ }
+
::osl::ClearableMutexGuard aGuard( maMutex );
sal_Bool bIsInitialized = sal_False;
sal_Bool bNeedsUpdate = sal_False;
@@ -1263,7 +1290,7 @@ uno::Sequence< beans::StringPair > SfxDocTplService_Impl::ReadUINamesForTemplate
// TODO/LATER: Use hashmap in future
uno::Sequence< beans::StringPair > aUINames;
- if ( Content::create( aLocObj.GetMainURL( INetURLObject::NO_DECODE ), maCmdEnv, aLocContent ) )
+ if ( Content::create( aLocObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference < ucb::XCommandEnvironment >(), aLocContent ) )
{
try
{
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index ef766f1717..828428c2a3 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: objstor.cxx,v $
- * $Revision: 1.212 $
+ * $Revision: 1.212.44.1 $
*
* This file is part of OpenOffice.org.
*
@@ -2427,7 +2427,7 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs )
// copy the original itemset, but remove the "version" item, because pMediumTmp
// is a new medium "from scratch", so no version should be stored into it
- SfxItemSet* pSet = pRetrMedium->GetItemSet() ? new SfxAllItemSet(*pRetrMedium->GetItemSet()): 0;
+ SfxItemSet* pSet = new SfxAllItemSet(*pRetrMedium->GetItemSet());
pSet->ClearItem( SID_VERSION );
// create a medium as a copy; this medium is only for writingm, because it uses the same name as the original one
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 7f3b58275c..945a9c95e6 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2893,7 +2893,7 @@ void SfxViewFrame::StateView_Impl
case SID_NEWWINDOW:
{
- if ( !GetViewShell()->NewWindowAllowed() && !pDocSh->HasName() )
+ if ( !GetViewShell()->NewWindowAllowed() /* && !pDocSh->HasName() */ )
rSet.DisableItem( nWhich );
else
{
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 430e0b9ccb..b3d0469df7 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: viewprn.cxx,v $
- * $Revision: 1.36 $
+ * $Revision: 1.36.84.1 $
*
* This file is part of OpenOffice.org.
*
@@ -643,7 +643,10 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
// Collate
SFX_REQUEST_ARG(rReq, pCollateItem, SfxBoolItem, SID_PRINT_COLLATE, FALSE);
if ( pCollateItem )
+ {
bCollate = pCollateItem->GetValue();
+ pPrintDlg->CheckCollate( bCollate );
+ }
// Selection
SFX_REQUEST_ARG(rReq, pSelectItem, SfxBoolItem, SID_SELECTION, FALSE);