summaryrefslogtreecommitdiff
path: root/starmath/source/view.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'starmath/source/view.cxx')
-rw-r--r--starmath/source/view.cxx28
1 files changed, 21 insertions, 7 deletions
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 7daf0758e3..888bbcd96c 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -1211,6 +1211,9 @@ SfxPrinter* SmViewShell::GetPrinter(BOOL bCreate)
USHORT SmViewShell::SetPrinter(SfxPrinter *pNewPrinter, USHORT nDiffFlags, bool )
{
RTL_LOGFILE_CONTEXT( aLog, "starmath: SmViewShell::SetPrinter" );
+ SfxPrinter *pOld = GetDoc()->GetPrinter();
+ if ( pOld && pOld->IsPrinting() )
+ return SFX_PRINTERROR_BUSY;
if ((nDiffFlags & SFX_PRINTER_PRINTER) == SFX_PRINTER_PRINTER)
GetDoc()->SetPrinter( pNewPrinter );
@@ -1586,7 +1589,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
pImpl->pDocInserter =
new ::sfx2::DocumentInserter( 0, GetDoc()->GetFactory().GetFactoryName(), 0 );
pImpl->pDocInserter->StartExecuteModal( LINK( this, SmViewShell, DialogClosedHdl ) );
- return;
+ break;
}
case SID_NEXTERR:
@@ -1714,8 +1717,6 @@ void SmViewShell::Execute(SfxRequest& rReq)
SmSymbolDialog( NULL, pDev, pp->GetSymSetManager(), *this ).Execute();
}
break;
-
-
}
rReq.Done();
}
@@ -1742,7 +1743,6 @@ void SmViewShell::GetState(SfxItemSet &rSet)
case SID_PASTE:
if( !xClipEvtLstnr.is() && pEditWin)
{
- AddRemoveClipboardListener( TRUE );
TransferableDataHelper aDataHelper(
TransferableDataHelper::CreateFromSystemClipboard(
pEditWin) );
@@ -1832,8 +1832,6 @@ SmViewShell::~SmViewShell()
{
RTL_LOGFILE_CONTEXT( aLog, "starmath: SmViewShell::~SmViewShell" );
- AddRemoveClipboardListener( FALSE );
-
//!! this view shell is not active anymore !!
// Thus 'SmGetActiveView' will give a 0 pointer.
// Thus we need to supply this view as argument
@@ -1910,3 +1908,19 @@ IMPL_LINK( SmViewShell, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg )
return 0;
}
+void SmViewShell::Notify( SfxBroadcaster& , const SfxHint& rHint )
+{
+ if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ {
+ switch( ( (SfxSimpleHint&) rHint ).GetId() )
+ {
+ case SFX_HINT_MODECHANGED:
+ case SFX_HINT_DOCCHANGED:
+ GetViewFrame()->GetBindings().InvalidateAll(FALSE);
+ break;
+ default:
+ break;
+ }
+ }
+}
+