[ooo-build-commit] Branch 'ooo/master' - 4 commits - starmath/inc starmath/sdi starmath/source sw/inc sw/sdi sw/source
Jan Holesovsky
kendy at kemper.freedesktop.org
Fri Sep 18 20:20:23 PDT 2009
starmath/inc/edit.hxx | 1
starmath/inc/view.hxx | 3
starmath/sdi/smath.sdi | 20 ++--
starmath/source/document.cxx | 12 ++
starmath/source/edit.cxx | 13 ++
starmath/source/makefile.mk | 2
starmath/source/view.cxx | 28 ++++-
starmath/source/viewhdl.cxx | 170 ------------------------------------
sw/inc/cmdid.h | 1
sw/inc/docsh.hxx | 2
sw/inc/pch/precompiled_sw.hxx | 3
sw/inc/swevent.hxx | 16 +++
sw/sdi/_annotsh.sdi | 24 ++---
sw/sdi/_basesh.sdi | 6 -
sw/sdi/_docsh.sdi | 3
sw/sdi/drwtxtsh.sdi | 4
sw/sdi/makefile.mk | 6 -
sw/sdi/swriter.sdi | 45 ++-------
sw/sdi/viewsh.sdi | 10 +-
sw/sdi/wdocsh.sdi | 1
sw/sdi/wviewsh.sdi | 10 +-
sw/source/core/doc/docdde.cxx | 2
sw/source/core/layout/layact.cxx | 3
sw/source/core/unocore/unocoll.cxx | 14 ++
sw/source/core/unocore/unoevent.cxx | 121 -------------------------
sw/source/filter/html/htmlbas.cxx | 31 ++++--
sw/source/filter/html/htmlgrin.cxx | 14 +-
sw/source/filter/html/swhtml.hxx | 2
sw/source/ui/app/docsh.cxx | 85 +++++++-----------
sw/source/ui/app/docsh2.cxx | 19 ++--
sw/source/ui/app/swmodule.cxx | 5 -
sw/source/ui/dbui/dbmgr.cxx | 38 ++++----
sw/source/ui/dbui/mmoutputpage.cxx | 10 +-
sw/source/ui/docvw/srcedtw.cxx | 12 +-
sw/source/ui/inc/wrtsh.hxx | 2
sw/source/ui/shells/annotsh.cxx | 12 +-
sw/source/ui/shells/basesh.cxx | 26 ++---
sw/source/ui/shells/drwtxtex.cxx | 19 ++--
sw/source/ui/shells/drwtxtsh.cxx | 1
sw/source/ui/uiview/pview.cxx | 8 +
sw/source/ui/uiview/srcview.cxx | 19 +++-
sw/source/ui/uiview/uivwimp.cxx | 40 --------
sw/source/ui/uiview/view.cxx | 4
sw/source/ui/uiview/view2.cxx | 30 +++---
sw/source/ui/uiview/viewprt.cxx | 30 ++++--
sw/source/ui/uno/unomailmerge.cxx | 6 -
sw/source/ui/wrtsh/select.cxx | 20 ++++
47 files changed, 371 insertions(+), 582 deletions(-)
New commits:
commit 2350d3f737145197d2c3543410c941bf0ee518c8
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date: Fri Sep 18 14:11:07 2009 +0000
CWS-TOOLING: integrate CWS sw32bf03
2009-09-11 16:05:24 +0200 od r276069 : CWS-TOOLING: rebase CWS sw32bf03 to trunk at 276043 (milestone: DEV300:m58)
2009-09-10 15:26:00 +0200 od r276036 : #i104937# method <template<FlyCntType T> SwXFrameEnumeration<T>::SwXFrameEnumeration(..)>
- Correct iteration on <SwSpzFrmFmts> instance.
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index 93c542c..e4f7138 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -898,10 +898,20 @@ SwXFrameEnumeration<T>::SwXFrameEnumeration(const SwDoc* const pDoc)
const SwSpzFrmFmts* const pFmts = pDoc->GetSpzFrmFmts();
if(!pFmts->Count())
return;
- const SwFrmFmt* const pFmtsEnd = (*pFmts)[pFmts->Count()];
+ // --> OD 2009-09-10 #i104937#
+// const SwFrmFmt* const pFmtsEnd = (*pFmts)[pFmts->Count()];
+ const USHORT nSize = pFmts->Count();
+ // <--
::std::insert_iterator<frmcontainer_t> pInserter = ::std::insert_iterator<frmcontainer_t>(m_aFrames, m_aFrames.begin());
- for(SwFrmFmt* pFmt = (*pFmts)[0]; pFmt < pFmtsEnd; ++pFmt)
+ // --> OD 2009-09-10 #i104937#
+ SwFrmFmt* pFmt( 0 );
+ for( USHORT i = 0; i < nSize; ++i )
+// for(SwFrmFmt* pFmt = (*pFmts)[0]; pFmt < pFmtsEnd; ++pFmt)
+ // <--
{
+ // --> OD 2009-09-10 #i104937#
+ pFmt = (*pFmts)[i];
+ // <--
if(pFmt->Which() != RES_FLYFRMFMT)
continue;
const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx();
commit a7f3fba76c4368914546a7db8a333ddd668704cf
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date: Fri Sep 18 12:40:04 2009 +0000
CWS-TOOLING: integrate CWS cmcfixes63
2009-09-16 11:24:47 +0200 cmc r276193 : #i105118# remove overly const warnings for -Wall
2009-09-15 18:04:24 +0200 cmc r276183 : #i105089# fix include
2009-09-15 14:30:55 +0200 cmc r276176 : #i105090# fix includes for s390x bridge
diff --git a/sw/source/core/doc/docdde.cxx b/sw/source/core/doc/docdde.cxx
index 53ba7a2..2454a26 100644
--- a/sw/source/core/doc/docdde.cxx
+++ b/sw/source/core/doc/docdde.cxx
@@ -62,7 +62,7 @@ using namespace ::com::sun::star;
namespace
{
- static ::sw::mark::DdeBookmark* const lcl_FindDdeBookmark(const IDocumentMarkAccess& rMarkAccess, const String& rName, bool bCaseSensitive)
+ static ::sw::mark::DdeBookmark* lcl_FindDdeBookmark(const IDocumentMarkAccess& rMarkAccess, const String& rName, bool bCaseSensitive)
{
//Iterating over all bookmarks, checking DdeBookmarks
const ::rtl::OUString sNameLc = bCaseSensitive ? rName : GetAppCharClass().lower(rName);
commit 9a950df245fd146347cc19aa62c1f41f1eea95f0
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date: Fri Sep 18 12:31:43 2009 +0000
CWS-TOOLING: integrate CWS calc32stopper1
2009-09-15 15:43:23 +0200 dr r276180 : newpic
2009-09-15 15:41:13 +0200 dr r276179 : newpic
2009-09-15 14:58:14 +0200 dr r276178 : #i104905# fixed note handling while importing from external data
2009-09-15 13:47:43 +0200 dr r276173 : #i104905# fixed note handling while importing from database
2009-09-15 11:56:00 +0200 dr r276164 : #i104155# prevent crash loading docx
2009-09-15 10:40:43 +0200 dr r276154 : #i104990#
2009-09-15 10:27:31 +0200 dr r276152 : #i104990# enable saving BIFF8 with password/encryption
2009-09-15 10:26:40 +0200 dr r276151 : #i104990# enable saving BIFF8 with password/encryption
2009-09-14 19:13:11 +0200 dr r276145 : #i105007# missing cleanup for deleted headers
2009-09-14 19:06:57 +0200 dr r276144 : #i105007# missing cleanup for deleted headers
2009-09-14 18:53:39 +0200 dr r276143 : #i104915# prevent crashes and misbehaviour when dealing with note cells: enter matrix, enter mult.op
2009-09-14 13:57:00 +0200 dr r276109 : #160184# make drilldown working in exported pivottables, ported to DEV300
2009-09-11 15:16:08 +0200 nn r276068 : #i104987# MoveBlock: pass bCut parameter
2009-09-11 15:15:22 +0200 nn r276067 : #i104986# CopyToClip: correct order of parameters
2009-09-11 09:45:59 +0200 dr r276053 : correct milestone
diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx
index 68e324e..0a43d2c 100644
--- a/sw/inc/pch/precompiled_sw.hxx
+++ b/sw/inc/pch/precompiled_sw.hxx
@@ -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
@@ -626,7 +626,6 @@
#include "svtools/ctloptions.hxx"
#include "svtools/ctrlbox.hxx"
#include "svtools/ctrltool.hxx"
-#include "svtools/docpasswdrequest.hxx"
#include "svtools/editbrowsebox.hxx"
#include "svtools/ehdl.hxx"
#include "svtools/eitem.hxx"
commit 3ff75ae0ccd967df6a220144b6a9a7f54ea546ec
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date: Fri Sep 18 10:15:03 2009 +0000
CWS-TOOLING: integrate CWS mba32issues02
2009-09-17 mb93783 merge commit
2009-09-03 tb121644 #i104748 - slot unification to .uno:PasteSpecial
2009-09-01 mba #101455#: code simplification
2009-08-31 mb93783 iso locales for norwegian builds are nb and nn, not no
2009-08-25 mba merge to m55
2009-07-29 mba cleanup after rebase
2009-07-29 mba #i103200#: wrong order of first and last name in CJK UI
2009-07-27 mba adding dictionary changes from broken svn CWS
2009-07-27 mba adding dictionary changes from broken svn CWS
2009-07-27 mba apply patch from broken svn CWS
diff --git a/starmath/inc/edit.hxx b/starmath/inc/edit.hxx
index 87b7ece..c6e3121 100644
--- a/starmath/inc/edit.hxx
+++ b/starmath/inc/edit.hxx
@@ -99,6 +99,7 @@ class SmEditWindow : public Window, public DropTargetHelper
Rectangle AdjustScrollBars();
void SetScrollBarRanges();
void InitScrollBars();
+ void InvalidateSlots();
public:
SmEditWindow( SmCmdBoxWindow &rMyCmdBoxWin );
diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx
index 1ea4852..8ccc39f 100644
--- a/starmath/inc/view.hxx
+++ b/starmath/inc/view.hxx
@@ -228,9 +228,8 @@ class SmViewShell: public SfxViewShell
SmViewShell_Impl* pImpl;
BOOL bPasteState;
- void AddRemoveClipboardListener( BOOL bAdd );
-
DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* );
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
protected:
diff --git a/starmath/sdi/smath.sdi b/starmath/sdi/smath.sdi
index c36682b..9d1bd22 100644
--- a/starmath/sdi/smath.sdi
+++ b/starmath/sdi/smath.sdi
@@ -32,7 +32,7 @@ SfxVoidItem Adjust SID_ADJUST
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -259,7 +259,7 @@ SfxVoidItem Draw SID_DRAW
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -488,7 +488,7 @@ SfxVoidItem NextError SID_NEXTERR
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -513,7 +513,7 @@ SfxVoidItem NextMark SID_NEXTMARK
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -563,7 +563,7 @@ SfxVoidItem PrevError SID_PREVERR
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -588,7 +588,7 @@ SfxVoidItem PrevMark SID_PREVMARK
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -612,8 +612,8 @@ SfxBoolItem RedrawAutomatic SID_AUTO_REDRAW
[
/* flags: */
- AutoUpdate = FALSE,
- Cachable = Volatile,
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -740,7 +740,7 @@ SfxBoolItem Textmode SID_TEXTMODE
[
/* flags: */
AutoUpdate = TRUE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -819,7 +819,7 @@ SfxBoolItem ToolBox SID_TOOLBOX
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index fd13d59..48e5f8f 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -1176,9 +1176,21 @@ void SmDocShell::Execute(SfxRequest& rReq)
(pTmpUndoMgr->*fnDo)( 0 );
}
Repaint();
+ SfxViewFrame* pFrm = SfxViewFrame::GetFirst( this );
+ while( pFrm )
+ {
+ SfxBindings& rBind = pFrm->GetBindings();
+ rBind.Invalidate(SID_UNDO);
+ rBind.Invalidate(SID_REDO);
+ rBind.Invalidate(SID_REPEAT);
+ rBind.Invalidate(SID_CLEARHISTORY);
+ pFrm = SfxViewFrame::GetNext( *pFrm, this );
+ }
}
break;
}
+
+ rReq.Done();
}
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index 714310f..0e4542b 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -60,7 +60,7 @@
#include <svx/lrspitem.hxx>
#include <svtools/itemset.hxx>
#include <svx/fontitem.hxx>
-
+#include <sfx2/viewfrm.hxx>
#include "edit.hxx"
#include "view.hxx"
@@ -163,6 +163,13 @@ SmEditWindow::~SmEditWindow()
delete pScrollBox;
}
+void SmEditWindow::InvalidateSlots()
+{
+ SfxBindings& rBind = GetView()->GetViewFrame()->GetBindings();
+ rBind.Invalidate(SID_COPY);
+ rBind.Invalidate(SID_CUT);
+ rBind.Invalidate(SID_DELETE);
+}
SmViewShell * SmEditWindow::GetView()
{
@@ -317,6 +324,7 @@ void SmEditWindow::MouseButtonUp(const MouseEvent &rEvt)
// ggf FormulaCursor neu positionieren
CursorMoveTimerHdl(&aCursorMoveTimer);
+ InvalidateSlots();
}
void SmEditWindow::MouseButtonDown(const MouseEvent &rEvt)
@@ -460,6 +468,8 @@ void SmEditWindow::KeyInput(const KeyEvent& rKEvt)
aModifyTimer.Start();
}
+
+ InvalidateSlots();
}
}
@@ -855,6 +865,7 @@ void SmEditWindow::SetSelection(const ESelection &rSel)
DBG_ASSERT( pEditView, "NULL pointer" );
if (pEditView)
pEditView->SetSelection(rSel);
+ InvalidateSlots();
}
BOOL SmEditWindow::IsEmpty() const
diff --git a/starmath/source/makefile.mk b/starmath/source/makefile.mk
index 0f604a2..53f6569 100644
--- a/starmath/source/makefile.mk
+++ b/starmath/source/makefile.mk
@@ -73,7 +73,6 @@ SLO1FILES = \
$(SLO)$/smmod.obj \
$(SLO)$/types.obj \
$(SLO)$/view.obj \
- $(SLO)$/viewhdl.obj \
$(SLO)$/edit.obj \
$(SLO)$/rect.obj \
$(SLO)$/unomodel.obj \
@@ -99,7 +98,6 @@ EXCEPTIONSFILES = \
$(SLO)$/mathmlexport.obj \
$(SLO)$/mathtype.obj \
$(SLO)$/view.obj \
- $(SLO)$/viewhdl.obj \
$(SLO)$/unomodel.obj \
$(SLO)$/smdetect.obj \
$(SLO)$/symbol.obj \
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 7daf075..888bbcd 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;
+ }
+ }
+}
+
diff --git a/starmath/source/viewhdl.cxx b/starmath/source/viewhdl.cxx
deleted file mode 100644
index 11ab8d6..0000000
--- a/starmath/source/viewhdl.cxx
+++ /dev/null
@@ -1,170 +0,0 @@
-/*************************************************************************
- *
- * 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
- *
- * $RCSfile: viewhdl.cxx,v $
- * $Revision: 1.10 $
- *
- * 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_starmath.hxx"
-
-
-#include <view.hxx>
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp>
-#include <com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp>
-#include <vos/mutex.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <svtools/transfer.hxx>
-#include <sfx2/bindings.hxx>
-#include <sfx2/sfxsids.hrc>
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::datatransfer::clipboard;
-
-// --------------------------- Clipboard EventListener ------------------
-
-class SmClipboardChangeListener : public ::cppu::WeakImplHelper1<
- ::com::sun::star::datatransfer::clipboard::XClipboardListener >
-{
- SmViewShell* pView;
-
- // XEventListener
- virtual void SAL_CALL disposing(
- const lang::EventObject& rEventObject ) throw ( ::com::sun::star::uno::RuntimeException)
-;// throw( UNO_NMSPC::RuntimeException );
-
- // XClipboardListener
- virtual void SAL_CALL changedContents(
- const datatransfer::clipboard::ClipboardEvent& rEventObject ) throw ( ::com::sun::star::uno::RuntimeException)
-;// throw( UNO_NMSPC::RuntimeException );
-
-public:
- SmClipboardChangeListener( SmViewShell& rView ) : pView( &rView ) {}
- virtual ~SmClipboardChangeListener();
-
- void ViewDestroyed() { pView = 0; }
-
- void AddRemoveListener( BOOL bAdd );
-};
-
-
-
-// ------------------------- SmClipboardChangeListener ---------------------
-
-SmClipboardChangeListener::~SmClipboardChangeListener()
-{
-}
-
-void SAL_CALL SmClipboardChangeListener::disposing(
- const lang::EventObject& /*rEventObject*/ ) throw ( ::com::sun::star::uno::RuntimeException)
-{
-}
-
-void SAL_CALL SmClipboardChangeListener::changedContents(
- const ClipboardEvent& rEventObject ) throw ( ::com::sun::star::uno::RuntimeException)
-{
- const ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- if( pView )
- {
- {
- TransferableDataHelper aDataHelper( rEventObject.Contents );
- sal_Bool bHasTransferable = aDataHelper.GetTransferable().is();
-
- //! according to CD the above call to GetTransferable may create a (new)
- //! message loop and thus result in re-entrant code.
- //! Thus it was suggested to check 'pView' here again.
- if (pView)
- {
- pView->bPasteState = bHasTransferable &&
- ( aDataHelper.HasFormat( FORMAT_STRING ) ||
- aDataHelper.HasFormat( SOT_FORMATSTR_ID_EMBEDDED_OBJ ) ||
- (aDataHelper.HasFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR )
- && aDataHelper.HasFormat( SOT_FORMATSTR_ID_EMBED_SOURCE )));
- }
- }
-
- if (pView)
- {
- SfxBindings& rBind = pView->GetViewFrame()->GetBindings();
- rBind.Invalidate( SID_PASTE );
- }
- }
-}
-
-void SmClipboardChangeListener::AddRemoveListener( BOOL bAdd )
-{
- try
- {
- do {
- Window* pW;
- Reference< XClipboard > xClipboard;
- if( pView && 0 != ( pW = pView->GetEditWindow()) )
- xClipboard = pW->GetClipboard();
- if( !xClipboard.is() )
- break;
-
- Reference< XClipboardNotifier > xClpbrdNtfr( xClipboard, UNO_QUERY );
- if( xClpbrdNtfr.is() )
- {
- Reference< XClipboardListener > xClipEvtLstnr( this );
- if( bAdd )
- xClpbrdNtfr->addClipboardListener( xClipEvtLstnr );
- else
- xClpbrdNtfr->removeClipboardListener( xClipEvtLstnr );
- }
- } while ( FALSE );
- }
- catch( const ::com::sun::star::uno::Exception& )
- {
- }
-}
-
-// ------------------------- SmViewShell ---------------------
-
-void SmViewShell::AddRemoveClipboardListener( BOOL bAdd )
-{
- // AddRemoveListener and ViewDestroyed below should be an
- // atomic operation and must not be 'interrupted' by other code
- const ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- if( bAdd && !xClipEvtLstnr.is() )
- {
- xClipEvtLstnr = pClipEvtLstnr = new SmClipboardChangeListener( *this );
- pClipEvtLstnr->AddRemoveListener( TRUE );
- }
- else if( !bAdd && xClipEvtLstnr.is() )
- {
- pClipEvtLstnr->AddRemoveListener( FALSE );
- pClipEvtLstnr->ViewDestroyed();
- }
-}
-
-
-
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 76362f6..0ea7953 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -153,7 +153,6 @@ Achtung: Ab sofort sind in diesem File keine C++-Kommentare (//) mehr
#define FN_GOTO (FN_EDIT + 11) /* Gehe zu */
#define FN_PASTE (FN_EDIT + 13) /* Einfuegen */
-#define FN_PASTESPECIAL (FN_EDIT + 14) /* Verknuepfung einfuegen */
#define FN_PASTESPECIAL_DLG (FN_EDIT + 15) /* Verknuepfung einfuegen */
#define FN_NUMBER_BULLETS (FN_EDIT + 21) /* Bullets */
#define FN_REPEAT (FN_EDIT + 22) /* Letzten Befehl wiederholen */
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index b7a1cf3..62b4848 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -151,6 +151,8 @@ public:
static SfxInterface *_GetInterface() { return GetStaticInterface(); }
+ static rtl::OUString GetEventName( sal_Int32 nId );
+
//Das Doc wird fuer SO-Datenaustausch benoetigt!
SwDocShell( SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED, sal_Bool _bScriptingSupport = sal_True );
SwDocShell( SwDoc *pDoc, SfxObjectCreateMode eMode = SFX_CREATE_MODE_STANDARD );
diff --git a/sw/inc/swevent.hxx b/sw/inc/swevent.hxx
index 6020633..ad6bee6 100644
--- a/sw/inc/swevent.hxx
+++ b/sw/inc/swevent.hxx
@@ -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
@@ -50,6 +50,20 @@
#define SW_EVENT_FIELD_MERGE_FINISHED ( EVENT_APP_START + 11 )
#define SW_EVENT_LAYOUT_FINISHED ( EVENT_APP_START + 12 )
+#define STR_SW_EVENT_PAGE_COUNT 0
+#define STR_SW_EVENT_MAIL_MERGE 1
+#define STR_SW_EVENT_MAIL_MERGE_END 2
+#define STR_SW_EVENT_FIELD_MERGE 3
+#define STR_SW_EVENT_FIELD_MERGE_FINISHED 4
+#define STR_SW_EVENT_LAYOUT_FINISHED 5
+#define STR_SW_EVENT_OBJECT_SELECT 6
+#define STR_SW_EVENT_START_INS_GLOSSARY 7
+#define STR_SW_EVENT_END_INS_GLOSSARY 8
+#define STR_SW_EVENT_FRM_KEYINPUT_ALPHA 9
+#define STR_SW_EVENT_FRM_KEYINPUT_NOALPHA 10
+#define STR_SW_EVENT_FRM_RESIZE 11
+#define STR_SW_EVENT_FRM_MOVE 12
+
class SwFrmFmt;
class SwFmtINetFmt;
class IMapObject;
diff --git a/sw/sdi/_annotsh.sdi b/sw/sdi/_annotsh.sdi
index 6291061..d98339e 100755
--- a/sw/sdi/_annotsh.sdi
+++ b/sw/sdi/_annotsh.sdi
@@ -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
@@ -36,7 +36,7 @@ interface _Annotation
ExecMethod = NoteExec ;
StateMethod = GetNoteState ;
]
-
+
FN_DELETE_NOTE
[
ExecMethod = NoteExec ;
@@ -72,7 +72,7 @@ interface _Annotation
ExecMethod = NoteExec ;
StateMethod = GetNoteState ;
]
-
+
FN_POSTIT
[
ExecMethod = NoteExec ;
@@ -88,12 +88,11 @@ interface _Annotation
[
ExecMethod = NoteExec ;
]
-
+
SfxVoidItem Cut SID_CUT ( ) // api:
[
ExecMethod = ExecClpbrd ;
StateMethod = StateClpbrd ;
- Volatile ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
@@ -101,7 +100,6 @@ interface _Annotation
[
ExecMethod = ExecClpbrd ;
StateMethod = StateClpbrd ;
- Volatile ;
]
SID_PASTE // api:
@@ -111,7 +109,7 @@ interface _Annotation
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
- FN_PASTESPECIAL // api:
+ SID_PASTE_SPECIAL // api:
[
StateMethod = StateClpbrd ;
ExecMethod = ExecClpbrd ;
@@ -124,13 +122,13 @@ interface _Annotation
ExecMethod = ExecClpbrd ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
-
+
SID_SELECTALL // api:
[
ExecMethod = Exec ;
StateMethod = NoState ;
]
-
+
SID_UNDO // api:
[
ExecMethod = ExecUndo ;
@@ -143,7 +141,7 @@ interface _Annotation
[
ExecMethod = ExecUndo ;
StateMethod = StateUndo ;
-
+
]
SID_REPEAT // api:
@@ -167,12 +165,12 @@ interface _Annotation
StateMethod = NoState ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
-
+
FN_FORMAT_FOOTNOTE_DLG // status()
[
ExecMethod = Exec ;
]
-
+
SID_OPEN_XML_FILTERSETTINGS // ole : no, status : ?
[
ExecMethod = Exec ;
@@ -193,7 +191,7 @@ interface _Annotation
ExecMethod = Exec ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
-
+
FN_INSERT_STRING
[
ExecMethod = Exec ;
diff --git a/sw/sdi/_basesh.sdi b/sw/sdi/_basesh.sdi
index e7c156e..0a37050 100644
--- a/sw/sdi/_basesh.sdi
+++ b/sw/sdi/_basesh.sdi
@@ -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
@@ -95,7 +95,6 @@ interface BaseTextSelection
[
ExecMethod = ExecClpbrd ;
StateMethod = StateClpbrd ;
- Volatile;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
@@ -103,7 +102,6 @@ interface BaseTextSelection
[
ExecMethod = ExecClpbrd ;
StateMethod = StateClpbrd ;
- Volatile;
]
SID_PASTE // status(final|play)
@@ -127,7 +125,7 @@ interface BaseTextSelection
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
- FN_PASTESPECIAL // status(final|play)
+ SID_PASTE_SPECIAL // status(final|play)
[
ExecMethod = ExecClpbrd ;
StateMethod = StateClpbrd ;
diff --git a/sw/sdi/_docsh.sdi b/sw/sdi/_docsh.sdi
index a8c2492..cf71e18 100644
--- a/sw/sdi/_docsh.sdi
+++ b/sw/sdi/_docsh.sdi
@@ -132,7 +132,8 @@ interface BaseTextDocument : OfficeDocument
[
ExecMethod = Execute;
StateMethod = GetState;
- ]
+ ]
+
FN_PRINT_LAYOUT
[
ExecMethod = Execute;
diff --git a/sw/sdi/drwtxtsh.sdi b/sw/sdi/drwtxtsh.sdi
index c55ab66..cb87291 100644
--- a/sw/sdi/drwtxtsh.sdi
+++ b/sw/sdi/drwtxtsh.sdi
@@ -43,7 +43,6 @@ interface TextDrawText
[
ExecMethod = ExecClpbrd ;
StateMethod = StateClpbrd ;
- Volatile ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
@@ -51,7 +50,6 @@ interface TextDrawText
[
ExecMethod = ExecClpbrd ;
StateMethod = StateClpbrd ;
- Volatile ;
]
SID_PASTE // api:
@@ -61,7 +59,7 @@ interface TextDrawText
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
- FN_PASTESPECIAL // api:
+ SID_PASTE_SPECIAL // api:
[
StateMethod = StateClpbrd ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
diff --git a/sw/sdi/makefile.mk b/sw/sdi/makefile.mk
index cc6ae3b..25b75fe 100644
--- a/sw/sdi/makefile.mk
+++ b/sw/sdi/makefile.mk
@@ -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
@@ -97,8 +97,10 @@ SVSDI1DEPEND= \
annotsh.sdi\
swslots.hrc \
$(INC)$/globals.hrc \
- $(INC)$/cmdid.h
+ $(INC)$/cmdid.h \
+ $(SOLARINCXDIR)$/svxslots.ilb
.ENDIF
+
# --- Targets -------------------------------------------------------
.INCLUDE : target.mk
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 7841006..315d341 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -821,7 +821,7 @@ SfxVoidItem ChangeDatabaseField FN_CHANGE_DBFIELD
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = TRUE,
@@ -1759,7 +1759,7 @@ SfxVoidItem ExecuteMacroField FN_EXECUTE_MACROFIELD
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -1809,7 +1809,7 @@ SfxVoidItem FieldDialog FN_EDIT_FIELD
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = TRUE,
@@ -4370,7 +4370,7 @@ SfxVoidItem InsertMultiIndex FN_INSERT_MULTI_TOX
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = TRUE,
@@ -6509,31 +6509,6 @@ SfxVoidItem PageUpSel FN_PAGEUP_SEL
]
//--------------------------------------------------------------------------
-SfxInt16Item PasteSpecial FN_PASTESPECIAL
-()
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Volatile,
- FastCall = TRUE,
- HasCoreId = FALSE,
- HasDialog = TRUE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Asynchron;
-
- /* config: */
- AccelConfig = TRUE,
- MenuConfig = TRUE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_EDIT;
-]
-
-//--------------------------------------------------------------------------
SfxVoidItem PreviewPrintOptions FN_PREVIEW_PRINT_OPTIONS
()
[
@@ -6592,7 +6567,7 @@ SfxBoolItem PrintLayout FN_PRINT_LAYOUT
[
/* flags: */
AutoUpdate = TRUE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -6873,7 +6848,7 @@ SfxBoolItem Ruler FN_RULER
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -7052,7 +7027,7 @@ SfxUInt16Item SelectionMode FN_STAT_SELMODE
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -7419,7 +7394,7 @@ SfxVoidItem SetOptimalColumnWidth FN_TABLE_ADJUST_CELLS
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = TRUE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -7930,7 +7905,7 @@ SfxStringItem StatePageNumber FN_STAT_PAGE
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -8708,7 +8683,7 @@ SfxBoolItem ViewBounds FN_VIEW_BOUNDS
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
diff --git a/sw/sdi/viewsh.sdi b/sw/sdi/viewsh.sdi
index 376f9c4..3d7ccb7 100644
--- a/sw/sdi/viewsh.sdi
+++ b/sw/sdi/viewsh.sdi
@@ -158,9 +158,17 @@ shell SwView : SfxViewShell
interface TextPrintPreview : View
[ uuid = "1622A480-111A-101D-9757-6E74207A7520" ]
{
+ SID_BROWSER_MODE
+ [
+ StateMethod = GetState;
+ ]
+ FN_PRINT_LAYOUT
+ [
+ ExecMethod = Execute;
+ StateMethod = GetState;
+ ]
FN_REFRESH_VIEW // status(final|play)
[
- ExecMethod = Execute ;
StateMethod = GetState ;
]
FN_CHAR_LEFT // status(final|play)
diff --git a/sw/sdi/wdocsh.sdi b/sw/sdi/wdocsh.sdi
index dd61919..478023a 100644
--- a/sw/sdi/wdocsh.sdi
+++ b/sw/sdi/wdocsh.sdi
@@ -38,7 +38,6 @@ interface WebDocument : BaseTextDocument
[
ExecMethod = Execute ;
StateMethod = GetState ;
- Volatile = TRUE;
Asynchron = TRUE;
]
diff --git a/sw/sdi/wviewsh.sdi b/sw/sdi/wviewsh.sdi
index c188822..f4b2bb2 100644
--- a/sw/sdi/wviewsh.sdi
+++ b/sw/sdi/wviewsh.sdi
@@ -144,7 +144,6 @@ interface WebSourceView : View
[
ExecMethod = Execute ;
StateMethod = GetState ;
- Volatile;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
@@ -152,7 +151,6 @@ interface WebSourceView : View
[
ExecMethod = Execute ;
StateMethod = GetState ;
- Volatile;
]
SID_PASTE // status(final|play)
@@ -187,6 +185,14 @@ interface WebSourceView : View
[
StateMethod = GetState ;
]
+ SID_BROWSER_MODE
+ [
+ StateMethod = GetState;
+ ]
+ FN_PRINT_LAYOUT
+ [
+ StateMethod = GetState;
+ ]
}
shell SwSrcView : SfxViewShell
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 68eb046..2718e15 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -3031,7 +3031,8 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
if ( !bInValid )
{
pRoot->ResetIdleFormat();
- pImp->GetShell()->GetDoc()->GetDocShell()->Broadcast( SfxEventHint( SW_EVENT_LAYOUT_FINISHED ) );
+ SfxObjectShell* pDocShell = pImp->GetShell()->GetDoc()->GetDocShell();
+ pDocShell->Broadcast( SfxEventHint( SW_EVENT_LAYOUT_FINISHED, SwDocShell::GetEventName(STR_SW_EVENT_LAYOUT_FINISHED), pDocShell ) );
}
}
diff --git a/sw/source/core/unocore/unoevent.cxx b/sw/source/core/unocore/unoevent.cxx
index 2351540..cfec12b 100644
--- a/sw/source/core/unocore/unoevent.cxx
+++ b/sw/source/core/unocore/unoevent.cxx
@@ -73,93 +73,6 @@ const sal_Char sAPI_SwHyperlinkEventDescriptor[] =
const sal_Char sAPI_SwAutoTextEventDescriptor[] =
"SwAutoTextEventDescriptor";
-
-// //
-// // tables of all known events handled by this class
-// //
-
-// // careful: keep aKnownEventIDs and aKnownEventNames in sync!
-
-// const USHORT aKnownEventIDs[] =
-// {
-// SW_EVENT_OBJECT_SELECT,
-// SW_EVENT_START_INS_GLOSSARY,
-// SW_EVENT_END_INS_GLOSSARY,
-// SW_EVENT_MAIL_MERGE,
-// SW_EVENT_FRM_KEYINPUT_ALPHA,
-// SW_EVENT_FRM_KEYINPUT_NOALPHA,
-// SW_EVENT_FRM_RESIZE,
-// SW_EVENT_FRM_MOVE,
-// SW_EVENT_PAGE_COUNT,
-// SFX_EVENT_MOUSEOVER_OBJECT,
-// SFX_EVENT_MOUSECLICK_OBJECT,
-// SFX_EVENT_MOUSEOUT_OBJECT,
-// SFX_EVENT_OPENDOC,
-// SFX_EVENT_CLOSEDOC,
-// SFX_EVENT_STARTAPP,
-// SFX_EVENT_CLOSEAPP,
-// SFX_EVENT_CREATEDOC,
-// SFX_EVENT_SAVEDOC,
-// SFX_EVENT_SAVEASDOC,
-// SFX_EVENT_ACTIVATEDOC,
-// SFX_EVENT_DEACTIVATEDOC,
-// SFX_EVENT_PRINTDOC,
-// SFX_EVENT_ONERROR,
-// SFX_EVENT_LOADFINISHED,
-// SFX_EVENT_SAVEFINISHED,
-// SFX_EVENT_MODIFYCHANGED,
-// SFX_EVENT_PREPARECLOSEDOC,
-// SFX_EVENT_NEWMESSAGE,
-// SFX_EVENT_TOGGLEFULLSCREENMODE,
-// SFX_EVENT_SAVEDOCDONE,
-// SFX_EVENT_SAVEASDOCDONE,
-// SVX_EVENT_IMAGE_LOAD,
-// SVX_EVENT_IMAGE_ABORT,
-// SVX_EVENT_IMAGE_ERROR,
-// 0
-// };
-
-// const sal_Char* aKnownEventNames[] =
-// {
-// "OnSelect", // SW_EVENT_OBJECT_SELECT
-// "OnInsertStart", // SW_EVENT_START_INS_GLOSSARY
-// "OnInsertDone", // SW_EVENT_END_INS_GLOSSARY
-// "OnMailMerge", // SW_EVENT_MAIL_MERGE
-// "OnAlphaCharInput", // SW_EVENT_FRM_KEYINPUT_ALPHA
-// "OnNonAlphaCharInput", // SW_EVENT_FRM_KEYINPUT_NOALPHA
-// "OnResize", // SW_EVENT_FRM_RESIZE
-// "OnMove", // SW_EVENT_FRM_MOVE
-// "PageCountChange", // SW_EVENT_PAGE_COUNT
-// "OnMouseOver", // SFX_EVENT_MOUSEOVER_OBJECT
-// "OnClick", // SFX_EVENT_MOUSECLICK_OBJECT
-// "OnMouseOut", // SFX_EVENT_MOUSEOUT_OBJECT
-// "OnLoad", // SFX_EVENT_OPENDOC,
-// "OnUnload", // SFX_EVENT_CLOSEDOC,
-// "OnStartApp", // SFX_EVENT_STARTAPP,
-// "OnCloseApp", // SFX_EVENT_CLOSEAPP,
-// "OnNew", // SFX_EVENT_CREATEDOC,
-// "OnSave", // SFX_EVENT_SAVEDOC,
-// "OnSaveAs", // SFX_EVENT_SAVEASDOC,
-// "OnFocus", // SFX_EVENT_ACTIVATEDOC,
-// "OnUnfocus", // SFX_EVENT_DEACTIVATEDOC,
-// "OnPrint", // SFX_EVENT_PRINTDOC,
-// "OnError", // SFX_EVENT_ONERROR,
-// "OnLoadFinished", // SFX_EVENT_LOADFINISHED,
-// "OnSaveFinished", // SFX_EVENT_SAVEFINISHED,
-// "OnModifyChanged", // SFX_EVENT_MODIFYCHANGED,
-// "OnPrepareUnload", // SFX_EVENT_PREPARECLOSEDOC,
-// "OnNewMail", // SFX_EVENT_NEWMESSAGE,
-// "OnToggleFullscreen", // SFX_EVENT_TOGGLEFULLSCREENMODE,
-// "OnSaveDone", // SFX_EVENT_SAVEDOCDONE,
-// "OnSaveAsDone", // SFX_EVENT_SAVEASDOCDONE,
-// "OnLoadError", // SVX_EVENT_IMAGE_LOAD,
-// "OnLoadCancel", // SVX_EVENT_IMAGE_ABORT,
-// "OnLoadDone", // SVX_EVENT_IMAGE_ERROR,
-
-// NULL
-// };
-
-
//
// tables of allowed events for specific objects
//
@@ -229,40 +142,6 @@ const struct SvEventDescription aFrameStyleEvents[] =
{ 0, NULL }
};
-const struct SvEventDescription aDocumentEvents[] =
-{
- { SFX_EVENT_STARTAPP, "OnStartApp" },
- { SFX_EVENT_CLOSEAPP, "OnCloseApp" },
- { SFX_EVENT_CREATEDOC, "OnNew" },
- { SFX_EVENT_OPENDOC, "OnLoad" },
- { SFX_EVENT_SAVEDOC, "OnSave" },
- { SFX_EVENT_SAVEASDOC, "OnSaveAs" },
-// ??? cf. SAVEDOCDONE, SAVEASDOCDONE
- { SFX_EVENT_SAVEFINISHED, "OnSaveFinished" },
- { SFX_EVENT_CLOSEDOC, "OnUnload" },
- { SFX_EVENT_ACTIVATEDOC, "OnFocus" },
- { SFX_EVENT_DEACTIVATEDOC, "OnUnfocus" },
- { SFX_EVENT_ONERROR, "OnError" },
- { SFX_EVENT_NEWMESSAGE, "OnNewMail" },
- { SFX_EVENT_PRINTDOC, "OnPrint" },
- { SW_EVENT_MAIL_MERGE, "OnMailMerge" },
- { SW_EVENT_PAGE_COUNT, "PageCountChange" },
- { SW_EVENT_FIELD_MERGE, "OnFieldMerge" },
- { SW_EVENT_FIELD_MERGE_FINISHED, "OnFieldMergeFinished" },
-// SFX_EVENT_LOADFINISHED,
-// SFX_EVENT_MODIFYCHANGED,
-// SFX_EVENT_PREPARECLOSEDOC,
-// SFX_EVENT_TOGGLEFULLSCREENMODE,
-// SFX_EVENT_SAVEDOCDONE,
-// SFX_EVENT_SAVEASDOCDONE,
-
- { 0, NULL }
-};
-
-
-
-
-
//
// SwHyperlinkEventDescriptor
//
diff --git a/sw/source/filter/html/htmlbas.cxx b/sw/source/filter/html/htmlbas.cxx
index 3f3a5aa..1eab2c7 100644
--- a/sw/source/filter/html/htmlbas.cxx
+++ b/sw/source/filter/html/htmlbas.cxx
@@ -47,6 +47,8 @@
#include <svtools/htmltokn.h>
#include <svtools/htmlkywd.hxx>
+#include <com/sun/star/document/XEventsSupplier.hpp>
+#include <com/sun/star/uno/Reference.hxx>
#include <fmtornt.hxx>
#include <fmtfld.hxx>
@@ -251,7 +253,7 @@ void SwHTMLParser::AddScriptSource()
}
}
-void SwHTMLParser::InsertBasicDocEvent( USHORT nEvent, const String& rName,
+void SwHTMLParser::InsertBasicDocEvent( rtl::OUString aEvent, const String& rName,
ScriptType eScrType,
const String& rScrType )
{
@@ -270,8 +272,10 @@ void SwHTMLParser::InsertBasicDocEvent( USHORT nEvent, const String& rName,
if( EXTENDED_STYPE == eScrType )
sScriptType = rScrType;
+ rtl::OUString aEventName;
+
SfxEventConfiguration* pECfg = SFX_APP()->GetEventConfig();
- pECfg->ConfigureEvent( nEvent, SvxMacro( sEvent, sScriptType, eScrType ),
+ pECfg->ConfigureEvent( aEvent, SvxMacro( sEvent, sScriptType, eScrType ),
pDocSh );
}
@@ -338,6 +342,10 @@ void SwHTMLWriter::OutBasic()
SFX_APP()->LeaveBasicCall();
}
+static const char* aEventNames[] =
+{
+ "OnLoad", "OnPrepareUnload", "OnFocus", "OnUnfocus"
+};
void SwHTMLWriter::OutBasicBodyEvents()
{
@@ -345,14 +353,19 @@ void SwHTMLWriter::OutBasicBodyEvents()
if( !pDocSh )
return;
- SfxEventConfiguration* pECfg = SFX_APP()->GetEventConfig();
- ASSERT( pECfg, "Wo ist die Event-Konfiguration?" );
- if( !pECfg )
- return;
+ SvxMacroTableDtor *pDocTable = new SvxMacroTableDtor;
+
+ uno::Reference< document::XEventsSupplier > xSup( pDocSh->GetModel(), uno::UNO_QUERY );
+ uno::Reference < container::XNameReplace > xEvents = xSup->getEvents();
+ for ( sal_Int32 i=0; i<4; i++ )
+ {
+ SvxMacro* pMacro = SfxEventConfiguration::ConvertToMacro( xEvents->getByName( ::rtl::OUString::createFromAscii(aEventNames[i]) ), pDocSh, TRUE );
+ if ( pMacro )
+ pDocTable->Insert( aBodyEventTable[i].nEvent, pMacro );
+ }
- SvxMacroTableDtor *pMacTable = pECfg->GetDocEventTable( pDocSh );
- if( pMacTable && pMacTable->Count() )
- HTMLOutFuncs::Out_Events( Strm(), *pMacTable, aBodyEventTable,
+ if( pDocTable && pDocTable->Count() )
+ HTMLOutFuncs::Out_Events( Strm(), *pDocTable, aBodyEventTable,
bCfgStarBasic, eDestEnc, &aNonConvertableCharacters );
}
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index a6c7c38..688ed14 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -53,7 +53,7 @@
#include <svtools/imap.hxx>
#include <svtools/htmltokn.h>
#include <svtools/htmlkywd.hxx>
-
+#include <svtools/eventcfg.hxx>
#include <fmtornt.hxx>
#include <fmturl.hxx>
@@ -841,7 +841,7 @@ void SwHTMLParser::InsertBodyOptions()
{
const HTMLOption *pOption = (*pHTMLOptions)[--i];
ScriptType eScriptType2 = eDfltScriptType;
- USHORT nEvent = 0;
+ rtl::OUString aEvent;
BOOL bSetEvent = FALSE;
switch( pOption->GetToken() )
@@ -872,28 +872,28 @@ void SwHTMLParser::InsertBodyOptions()
case HTML_O_SDONLOAD:
eScriptType2 = STARBASIC;
case HTML_O_ONLOAD:
- nEvent = SFX_EVENT_OPENDOC;
+ aEvent = GlobalEventConfig::GetEventName( STR_EVENT_OPENDOC );
bSetEvent = TRUE;
break;
case HTML_O_SDONUNLOAD:
eScriptType2 = STARBASIC;
case HTML_O_ONUNLOAD:
- nEvent = SFX_EVENT_PREPARECLOSEDOC;
+ aEvent = GlobalEventConfig::GetEventName( STR_EVENT_PREPARECLOSEDOC );
bSetEvent = TRUE;
break;
case HTML_O_SDONFOCUS:
eScriptType2 = STARBASIC;
case HTML_O_ONFOCUS:
- nEvent = SFX_EVENT_ACTIVATEDOC;
+ aEvent = GlobalEventConfig::GetEventName( STR_EVENT_ACTIVATEDOC );
bSetEvent = TRUE;
break;
case HTML_O_SDONBLUR:
eScriptType2 = STARBASIC;
case HTML_O_ONBLUR:
- nEvent = SFX_EVENT_DEACTIVATEDOC;
+ aEvent = GlobalEventConfig::GetEventName( STR_EVENT_DEACTIVATEDOC );
bSetEvent = TRUE;
break;
@@ -919,7 +919,7 @@ void SwHTMLParser::InsertBodyOptions()
{
const String& rEvent = pOption->GetString();
if( rEvent.Len() )
- InsertBasicDocEvent( nEvent, rEvent, eScriptType2,
+ InsertBasicDocEvent( aEvent, rEvent, eScriptType2,
sDfltScriptType );
}
}
diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx
index 2559dfa..9ba812b 100644
--- a/sw/source/filter/html/swhtml.hxx
+++ b/sw/source/filter/html/swhtml.hxx
@@ -782,7 +782,7 @@ private:
void AddScriptSource();
// ein Event in die SFX-Konfiguation eintragen (htmlbas.cxx)
- void InsertBasicDocEvent( sal_uInt16 nEvent, const String& rName,
+ void InsertBasicDocEvent( rtl::OUString aEventName, const String& rName,
ScriptType eScrType, const String& rScrType );
// ein Event an ein VC-Control anhaengen (htmlform.cxx)
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index 0d71a7f..ec29858 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.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
@@ -435,7 +435,7 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium )
if(pView)
pView->GetEditWin().StopQuickHelp();
- //#i91811# mod if we have an active margin window, write back the text
+ //#i91811# mod if we have an active margin window, write back the text
if (pView && pView->GetPostItMgr() && pView->GetPostItMgr()->GetActivePostIt())
pView->GetPostItMgr()->GetActivePostIt()->UpdateData();
@@ -582,7 +582,7 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium )
if(pView)
pView->GetEditWin().StopQuickHelp();
- //#i91811# mod if we have an active margin window, write back the text
+ //#i91811# mod if we have an active margin window, write back the text
if (pView && pView->GetPostItMgr() && pView->GetPostItMgr()->GetActivePostIt())
pView->GetPostItMgr()->GetActivePostIt()->UpdateData();
@@ -1083,15 +1083,10 @@ void SwDocShell::GetState(SfxItemSet& rSet)
break;
case SID_SOURCEVIEW:
{
- if(IsLoading())
- rSet.DisableItem(nWhich);
- else
- {
- SfxViewShell* pCurrView = GetView() ? (SfxViewShell*)GetView()
- : SfxViewShell::Current();
- BOOL bSourceView = 0 != PTR_CAST(SwSrcView, pCurrView);
- rSet.Put(SfxBoolItem(SID_SOURCEVIEW, bSourceView));
- }
+ SfxViewShell* pCurrView = GetView() ? (SfxViewShell*)GetView()
+ : SfxViewShell::Current();
+ BOOL bSourceView = 0 != PTR_CAST(SwSrcView, pCurrView);
+ rSet.Put(SfxBoolItem(SID_SOURCEVIEW, bSourceView));
}
break;
case SID_HTML_MODE:
@@ -1116,18 +1111,10 @@ void SwDocShell::GetState(SfxItemSet& rSet)
case SID_BROWSER_MODE:
case FN_PRINT_LAYOUT:
{
- SfxViewShell* pViewShell = SfxViewShell::Current();
- BOOL bDisable = 0 != PTR_CAST(SwPagePreView, pViewShell) ||
- 0 != PTR_CAST(SwSrcView, pViewShell);
- if (bDisable)
- rSet.DisableItem( nWhich );
- else
- {
- sal_Bool bState = GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE);
- if(FN_PRINT_LAYOUT == nWhich)
- bState = !bState;
- rSet.Put( SfxBoolItem( nWhich, bState));
- }
+ sal_Bool bState = GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE);
+ if(FN_PRINT_LAYOUT == nWhich)
+ bState = !bState;
+ rSet.Put( SfxBoolItem( nWhich, bState));
}
break;
@@ -1337,44 +1324,42 @@ uno::Reference< frame::XController >
/* -----------------------------12.02.01 12:08--------------------------------
---------------------------------------------------------------------------*/
+static const char* pEventNames[] =
+{
+ "OnPageCountChange",
+ "OnMailMerge",
+ "OnMailMergeFinished",
+ "OnFieldMerge",
+ "OnFieldMergeFinished",
+ "OnLayoutFinished"
+};
+
Sequence< OUString > SwDocShell::GetEventNames()
{
Sequence< OUString > aRet = SfxObjectShell::GetEventNames();
sal_Int32 nLen = aRet.getLength();
- aRet.realloc(nLen + 2);
+ aRet.realloc(nLen + 6);
OUString* pNames = aRet.getArray();
- pNames[nLen++] = OUString::createFromAscii("OnMailMerge");
- pNames[nLen] = OUString::createFromAscii("OnPageCountChange");
+ pNames[nLen++] = GetEventName(0);
+ pNames[nLen++] = GetEventName(1);
+ pNames[nLen++] = GetEventName(2);
+ pNames[nLen++] = GetEventName(3);
+ pNames[nLen++] = GetEventName(4);
+ pNames[nLen] = GetEventName(5);
+
return aRet;
}
-/*
-void SwTmpPersist::FillClass( SvGlobalName * pClassName,
- ULONG * pClipFormat,
- String * pAppName,
- String * pLongUserName,
- String * pUserName,
- sal_Int32 nFileFormat ) const
-{
- pDShell->SwDocShell::FillClass( pClassName, pClipFormat, pAppName,
- pLongUserName, pUserName, nFileFormat );
-}
-BOOL SwTmpPersist::Save()
-{
- if( SaveChilds() )
- return SvPersist::Save();
- return FALSE;
-}
+static sal_Int32 nEvents=13;
-BOOL SwTmpPersist::SaveCompleted( SvStorage * pStor )
+rtl::OUString SwDocShell::GetEventName( sal_Int32 nIndex )
{
- if( SaveCompletedChilds( pStor ) )
- return SvPersist::SaveCompleted( pStor );
- return FALSE;
-} */
+ if ( nIndex<nEvents )
+ return ::rtl::OUString::createFromAscii(pEventNames[nIndex]);
+ return rtl::OUString();
+}
const ::sfx2::IXmlIdRegistry* SwDocShell::GetXmlIdRegistry() const
{
return pDoc ? &pDoc->GetXmlIdRegistry() : 0;
}
-
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index 8cd955a..1b0a0c1 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -943,10 +943,10 @@ void SwDocShell::Execute(SfxRequest& rReq)
bDone = TRUE;
SfxEventConfiguration* pEvent = SFX_APP()->GetEventConfig();
SvxMacro aMac(aEmptyStr, aEmptyStr, STARBASIC);
- pEvent->ConfigureEvent(SFX_EVENT_OPENDOC, aMac, this);
- pEvent->ConfigureEvent(SFX_EVENT_CLOSEDOC, aMac, this);
- pEvent->ConfigureEvent(SFX_EVENT_ACTIVATEDOC, aMac, this);
- pEvent->ConfigureEvent(SFX_EVENT_DEACTIVATEDOC, aMac, this);
+ pEvent->ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_OPENDOC ), aMac, this);
+ pEvent->ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_PREPARECLOSEDOC ), aMac, this);
+ pEvent->ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_ACTIVATEDOC ), aMac, this);
+ pEvent->ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_DEACTIVATEDOC ), aMac, this);
ReloadFromHtml(aTempFile.GetURL(), pSrcView);
nSlot = 0;
}
@@ -983,6 +983,8 @@ void SwDocShell::Execute(SfxRequest& rReq)
//pSavePrinter darf nicht wieder geloescht werden
}
pViewFrm->GetBindings().SetState(SfxBoolItem(SID_SOURCEVIEW, nSlot == SID_VIEWSHELL2));
+ pViewFrm->GetBindings().Invalidate( SID_BROWSER_MODE );
+ pViewFrm->GetBindings().Invalidate( FN_PRINT_LAYOUT );
}
break;
case SID_GET_COLORTABLE:
@@ -1780,7 +1782,10 @@ void SwDocShell::ToggleBrowserMode(BOOL bSet, SwView* _pView )
SwView* pTempView = _pView ? _pView : (SwView*)GetView();
if( pTempView )
{
- pTempView->GetViewFrame()->GetBindings().Invalidate(FN_SHADOWCURSOR);
+ SfxBindings& rBind = pTempView->GetViewFrame()->GetBindings();
+ rBind.Invalidate(FN_SHADOWCURSOR);
+ rBind.Invalidate(SID_BROWSER_MODE);
+ rBind.Invalidate(FN_PRINT_LAYOUT);
if( !GetDoc()->getPrinter( false ) )
{
@@ -1793,8 +1798,8 @@ void SwDocShell::ToggleBrowserMode(BOOL bSet, SwView* _pView )
GetDoc()->CheckDefaultPageFmt();
// <--
- //Wenn wir die BrowseView einschalten, darf es nur diese eine
- //Sicht auf das Dokument geben, alle anderen werden geschlossen.
+ // Currently there can be only one view (layout) if the document is viewed in Web layout
+ // So if there are more views we are in print layout and for toggling to Web layout all other views must be closed
SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, 0, FALSE);
do {
if( pTmpFrm != pTempView->GetViewFrame() )
diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx
index ccc5a9f..779add8 100644
--- a/sw/source/ui/app/swmodule.cxx
+++ b/sw/source/ui/app/swmodule.cxx
@@ -221,11 +221,6 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
ERRCODE_AREA_SW_END,
pSwResMgr );
- SfxEventConfiguration::RegisterEvent(SW_EVENT_MAIL_MERGE, SW_RES(STR_PRINT_MERGE_MACRO), String::CreateFromAscii("OnMailMerge"));
- SfxEventConfiguration::RegisterEvent(SW_EVENT_MAIL_MERGE_END, SW_RES(STR_PRINT_MERGE_MACRO), String::CreateFromAscii("OnMailMergeFinished"));
- SfxEventConfiguration::RegisterEvent(SW_EVENT_FIELD_MERGE, String(), String::CreateFromAscii("OnFieldMerge"));
- SfxEventConfiguration::RegisterEvent(SW_EVENT_FIELD_MERGE_FINISHED, String(), String::CreateFromAscii("OnFieldMergeFinished"));
- SfxEventConfiguration::RegisterEvent(SW_EVENT_PAGE_COUNT, SW_RES(STR_PAGE_COUNT_MACRO), String::CreateFromAscii("OnPageCountChange"));
pModuleConfig = new SwModuleOptions;
//Die brauchen wie sowieso
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index 6306313..ef1bc33 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.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
@@ -932,9 +932,9 @@ BOOL SwNewDBMgr::MergePrint( SwView& rView,
do {
nStartRow = pImpl->pMergeData ? pImpl->pMergeData->xResultSet->getRow() : 0;
{
- SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE, pSh->GetView().GetViewFrame()->GetObjectShell()));
+ SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_FIELD_MERGE), pSh->GetView().GetViewFrame()->GetObjectShell()));
pSh->ViewShell::UpdateFlds();
- SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, pSh->GetView().GetViewFrame()->GetObjectShell()));
+ SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, SwDocShell::GetEventName(STR_SW_EVENT_FIELD_MERGE_FINISHED), pSh->GetView().GetViewFrame()->GetObjectShell()));
++rOpt.nMergeAct;
// launch MailMergeEvent if required
@@ -1080,7 +1080,7 @@ BOOL SwNewDBMgr::MergePrintDocuments( SwView& rView,
USHORT nDocEnd = pConfigItem->GetPrintRangeEnd();
DBG_ASSERT(nDocStart < nDocEnd && nDocEnd <= pConfigItem->GetMergedDocumentCount(),
"merge print settings are not correct");
-
+
for( sal_uInt32 nPrintDocument = nDocStart; nPrintDocument < nDocEnd; ++nPrintDocument)
{
SwDocMergeInfo& rDocInfo = pConfigItem->GetDocumentMergeInfo(nPrintDocument);
@@ -1455,9 +1455,9 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
SwDoc* pWorkDoc = ((SwDocShell*)(&xWorkDocSh))->GetDoc();
SwNewDBMgr* pOldDBMgr = pWorkDoc->GetNewDBMgr();
pWorkDoc->SetNewDBMgr( this );
- SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE, xWorkDocSh));
+ SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_FIELD_MERGE), xWorkDocSh));
pWorkDoc->UpdateFlds(NULL, false);
- SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, xWorkDocSh));
+ SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, SwDocShell::GetEventName(STR_SW_EVENT_FIELD_MERGE_FINISHED), xWorkDocSh));
// alle versteckten Felder/Bereiche entfernen
pWorkDoc->RemoveInvisibleContent();
@@ -2764,19 +2764,19 @@ String SwNewDBMgr::LoadAndRegisterDataSource()
if( bTextConnection )
{
- uno::Reference < ui::dialogs::XExecutableDialog > xSettingsDlg(
+ uno::Reference < ui::dialogs::XExecutableDialog > xSettingsDlg(
xMgr->createInstance( C2U( "com.sun.star.sdb.TextConnectionSettings" ) ), uno::UNO_QUERY);
if( xSettingsDlg->execute() )
{
uno::Any aSettings = xDataProperties->getPropertyValue( C2U( "Settings" ) );
uno::Reference < beans::XPropertySet > xDSSettings;
aSettings >>= xDSSettings;
- ::comphelper::copyProperties(
- uno::Reference < beans::XPropertySet >( xSettingsDlg, uno::UNO_QUERY ),
+ ::comphelper::copyProperties(
+ uno::Reference < beans::XPropertySet >( xSettingsDlg, uno::UNO_QUERY ),
xDSSettings );
xDSSettings->setPropertyValue( C2U("Extension"), uno::makeAny( ::rtl::OUString( sExt )));
}
- }
+ }
Reference<XDocumentDataSource> xDS(xNewInstance, UNO_QUERY_THROW);
Reference<XStorable> xStore(xDS->getDatabaseDocument(), UNO_QUERY_THROW);
@@ -2858,7 +2858,7 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
aDescriptor[daCursor] <<= xResSet;
SfxObjectShellRef xDocShell = rSh.GetView().GetViewFrame()->GetObjectShell();
- SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, xDocShell));
+ SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE), xDocShell));
{
//copy rSh to aTempFile
::rtl::OUString sTempURL;
@@ -2899,11 +2899,11 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
SwDoc* pWorkDoc = pView->GetWrtShell().GetDoc();
SwNewDBMgr* pWorkDBMgr = pWorkDoc->GetNewDBMgr();
pWorkDoc->SetNewDBMgr( this );
-
+
SwMergeDescriptor aMergeDesc( pImpl->pMergeDialog->GetMergeType(), pView->GetWrtShell(), aDescriptor );
- aMergeDesc.sSaveToFilter = pImpl->pMergeDialog->GetSaveFilter();
+ aMergeDesc.sSaveToFilter = pImpl->pMergeDialog->GetSaveFilter();
MergeNew(aMergeDesc);
-
+
pWorkDoc->SetNewDBMgr( pWorkDBMgr );
//close the temporary file
uno::Reference< util::XCloseable > xClose( xWorkDocSh->GetModel(), uno::UNO_QUERY );
@@ -2921,10 +2921,10 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
}
}
}
- //remove the temporary file
+ //remove the temporary file
SWUnoHelper::UCB_DeleteFile( sTempURL );
}
- SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE_END, rSh.GetView().GetViewFrame()->GetObjectShell()));
+ SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE_END, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE_END), rSh.GetView().GetViewFrame()->GetObjectShell()));
// reset the cursor inside
xResSet = NULL;
@@ -3260,9 +3260,9 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
// create a layout
rWorkShell.CalcLayout();
rWorkShell.UnlockExpFlds();
- SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE, rWorkShell.GetView().GetViewFrame()->GetObjectShell()));
- rWorkShell.ViewShell::UpdateFlds();
- SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, rWorkShell.GetView().GetViewFrame()->GetObjectShell()));
+ SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_FIELD_MERGE), rWorkShell.GetView().GetViewFrame()->GetObjectShell()));
+ rWorkShell.ViewShell::UpdateFlds();
+ SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, SwDocShell::GetEventName(STR_SW_EVENT_FIELD_MERGE_FINISHED), rWorkShell.GetView().GetViewFrame()->GetObjectShell()));
// strip invisible content and convert fields to text
rWorkShell.RemoveInvisibleContent();
diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx
index dd9f07e..eb1f75d 100644
--- a/sw/source/ui/dbui/mmoutputpage.cxx
+++ b/sw/source/ui/dbui/mmoutputpage.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
@@ -833,11 +833,11 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
aSaveMonitor.aCancel.SetClickHdl(LINK(this, SwMailMergeOutputPage, SaveCancelHdl_Impl));
aSaveMonitor.aPrinter.SetText( INetURLObject( sPath ).getFSysPath( INetURLObject::FSYS_DETECT ) );
aSaveMonitor.ResizeControls();
-
+
m_bCancelSaving = false;
aSaveMonitor.Show();
m_pWizard->enableButtons(WZB_CANCEL, sal_False);
-
+
for(sal_uInt32 nDoc = nBegin; nDoc < nEnd && !m_bCancelSaving; ++nDoc)
{
SwDocMergeInfo& rInfo = rConfigItem.GetDocumentMergeInfo(nDoc);
@@ -1000,14 +1000,14 @@ IMPL_LINK(SwMailMergeOutputPage, PrintHdl_Impl, PushButton*, EMPTYARG)
}
SfxObjectShell* pObjSh = pTargetView->GetViewFrame()->GetObjectShell();
- SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, pObjSh));
+ SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE), pObjSh));
rSh.GetNewDBMgr()->SetMergeType( DBMGR_MERGE_DOCUMENTS );
SfxDispatcher *pDis = pTargetView->GetViewFrame()->GetDispatcher();
SfxBoolItem aMergeSilent(SID_SILENT, sal_False);
m_pWizard->enableButtons(WZB_CANCEL, sal_False);
pDis->Execute(SID_PRINTDOCDIRECT,
SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD, &aMergeSilent, 0L);
- SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE_END, pObjSh));
+ SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE_END, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE_END), pObjSh));
pTargetView->SetMailMergeConfigItem(0, 0, sal_False);
m_pWizard->enableButtons(WZB_CANCEL, sal_True);
diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx
index 759fac9..ac67864 100644
--- a/sw/source/ui/docvw/srcedtw.cxx
+++ b/sw/source/ui/docvw/srcedtw.cxx
@@ -395,8 +395,10 @@ void TextViewOutWin::MouseButtonUp( const MouseEvent &rEvt )
if ( pTextView )
{
pTextView->MouseButtonUp( rEvt );
- ((SwSrcEditWindow*)GetParent())->GetSrcView()->GetViewFrame()->
- GetBindings().Invalidate( SID_TABLE_CELL );
+ SfxBindings& rBindings = ((SwSrcEditWindow*)GetParent())->GetSrcView()->GetViewFrame()->GetBindings();
+ rBindings.Invalidate( SID_TABLE_CELL );
+ rBindings.Invalidate( SID_CUT );
+ rBindings.Invalidate( SID_COPY );
}
}
@@ -459,6 +461,7 @@ void TextViewOutWin::KeyInput( const KeyEvent& rKEvt )
if(bChange)
bDone = pTextView->KeyInput( rKEvt );
+ SfxBindings& rBindings = ((SwSrcEditWindow*)GetParent())->GetSrcView()->GetViewFrame()->GetBindings();
if ( !bDone )
{
if ( !SfxViewShell::Current()->KeyInput( rKEvt ) )
@@ -466,7 +469,6 @@ void TextViewOutWin::KeyInput( const KeyEvent& rKEvt )
}
else
{
- SfxBindings& rBindings = ((SwSrcEditWindow*)GetParent())->GetSrcView()->GetViewFrame()->GetBindings();
rBindings.Invalidate( SID_TABLE_CELL );
if ( rKEvt.GetKeyCode().GetGroup() == KEYGROUP_CURSOR )
rBindings.Update( SID_BASICIDE_STAT_POS );
@@ -478,6 +480,10 @@ void TextViewOutWin::KeyInput( const KeyEvent& rKEvt )
if( rKEvt.GetKeyCode().GetCode() == KEY_INSERT )
rBindings.Invalidate( SID_ATTR_INSERT );
}
+
+ rBindings.Invalidate( SID_CUT );
+ rBindings.Invalidate( SID_COPY );
+
SwDocShell* pDocShell = pSrcEditWin->GetSrcView()->GetDocShell();
if(pSrcEditWin->GetTextEngine()->IsModified())
{
diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx
index f9d49cd..b3929ab 100644
--- a/sw/source/ui/inc/wrtsh.hxx
+++ b/sw/source/ui/inc/wrtsh.hxx
@@ -165,6 +165,8 @@ public:
// Selektion von Rahmen aufheben
void UnSelectFrm();
+ void Invalidate();
+
// Tabellenzellen selektieren fuer Bearbeiten von Formeln in der Ribbonbar
inline void SelTblCells( const Link &rLink, BOOL bMark = TRUE );
inline void EndSelTblCells();
diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx
index fd5303f..68b8e87 100755
--- a/sw/source/ui/shells/annotsh.cxx
+++ b/sw/source/ui/shells/annotsh.cxx
@@ -799,16 +799,18 @@ void SwAnnotationShell::ExecClpbrd(SfxRequest &rReq)
switch (nSlot)
{
case SID_CUT:
- pOLV->Cut();
+ if ( (pPostItMgr->GetActivePostIt()->GetStatus()!=SwPostItHelper::DELETED) && pOLV->HasSelection() )
+ pOLV->Cut();
break;
case SID_COPY:
- pOLV->Copy();
+ if( pOLV->HasSelection() )
+ pOLV->Copy();
break;
case SID_PASTE:
if (pPostItMgr->GetActivePostIt()->GetStatus()!=SwPostItHelper::DELETED)
pOLV->Paste();
break;
- case FN_PASTESPECIAL:
+ case SID_PASTE_SPECIAL:
{
if (pPostItMgr->GetActivePostIt()->GetStatus()!=SwPostItHelper::DELETED)
{
@@ -886,7 +888,7 @@ void SwAnnotationShell::StateClpbrd(SfxItemSet &rSet)
break;
}
case SID_PASTE:
- case FN_PASTESPECIAL:
+ case SID_PASTE_SPECIAL:
{
if( !bPastePossible )
rSet.DisableItem( nWhich );
@@ -1380,6 +1382,8 @@ void SwAnnotationShell::ExecUndo(SfxRequest &rReq)
}
}
+ rView.GetViewFrame()->GetBindings().InvalidateAll(sal_False);
+
if (rView.GetPostItMgr()->GetActivePostIt())
rView.GetPostItMgr()->GetActivePostIt()->ResizeIfNeccessary(aOldHeight,rView.GetPostItMgr()->GetActivePostIt()->GetPostItTextHeight());
}
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index 168441d..84b6f53 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.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
@@ -301,11 +301,9 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq)
if ( rSh.HasSelection() )
{
SwTransferable* pTransfer = new SwTransferable( rSh );
-/*??*/ uno::Reference<
- datatransfer::XTransferable > xRef(
- pTransfer );
+/*??*/ uno::Reference< datatransfer::XTransferable > xRef( pTransfer );
- if ( nId == SID_CUT )
+ if ( nId == SID_CUT && !rSh.IsSelObjProtected(FLYPROTECT_CONTENT|FLYPROTECT_PARENT) )
pTransfer->Cut();
else
{
@@ -395,7 +393,7 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq)
aReq.Done();
}
}
-
+
if (rSh.IsFrmSelected() || rSh.IsObjSelected())
rSh.EnterSelFrmMode();
pView->AttrChangedNotify( &rSh );
@@ -404,8 +402,8 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq)
return;
}
break;
-
- case FN_PASTESPECIAL:
+
+ case SID_PASTE_SPECIAL:
{
TransferableDataHelper aDataHelper(
TransferableDataHelper::CreateFromSystemClipboard(
@@ -481,10 +479,10 @@ void SwBaseShell::StateClpbrd(SfxItemSet &rSet)
rSet.DisableItem( SID_PASTE );
break;
- case FN_PASTESPECIAL:
+ case SID_PASTE_SPECIAL:
if( !GetView().IsPasteSpecialAllowed() )
{
- rSet.DisableItem( FN_PASTESPECIAL );
+ rSet.DisableItem( SID_PASTE_SPECIAL );
rSet.DisableItem( SID_PASTE_UNFORMATTED );
}
break;
@@ -539,6 +537,8 @@ void SwBaseShell::ExecUndo(SfxRequest &rReq)
default:
DBG_ERROR("falscher Dispatcher");
}
+
+ GetView().GetViewFrame()->GetBindings().InvalidateAll(sal_False);
}
/*--------------------------------------------------------------------
@@ -2547,7 +2547,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
//Hintergrundattribute der Tabelle holen und in den Set packen
SvxBrushItem aBrush(RES_BACKGROUND);
rSh.GetBoxBackground( aBrush );
- pDlg = pFact->CreateSfxDialog( pMDI, aSet,
+ pDlg = pFact->CreateSfxDialog( pMDI, aSet,
rView.GetViewFrame()->GetFrame()->GetFrameInterface(),
RC_SWDLG_BACKGROUND );
DBG_ASSERT(pDlg, "Dialogdiet fail!");
@@ -2566,7 +2566,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
rSh.GetFlyFrmAttr( aSet );
- pDlg = pFact->CreateSfxDialog( pMDI, aSet,
+ pDlg = pFact->CreateSfxDialog( pMDI, aSet,
rView.GetViewFrame()->GetFrame()->GetFrameInterface(),
RC_SWDLG_BACKGROUND );
DBG_ASSERT(pDlg, "Dialogdiet fail!");
@@ -2581,7 +2581,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
// Umrandungsattribute ganz normal ueber Shell setzen
rSh.GetCurAttr( aSet );
- pDlg = pFact->CreateSfxDialog( pMDI, aSet,
+ pDlg = pFact->CreateSfxDialog( pMDI, aSet,
rView.GetViewFrame()->GetFrame()->GetFrameInterface(),
RC_SWDLG_BACKGROUND );
DBG_ASSERT(pDlg, "Dialogdiet fail!");
diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx
index fc15241..60059cd 100644
--- a/sw/source/ui/shells/drwtxtex.cxx
+++ b/sw/source/ui/shells/drwtxtex.cxx
@@ -736,9 +736,9 @@ ASK_ESCAPE:
SvtCTLOptions aCTLOptions;
sal_Bool bEnabled = aCTLOptions.IsCTLFontEnabled();
GetView().GetViewFrame()->GetBindings().SetVisibleState( nWhich, bEnabled );
- if(!bEnabled)
- rSet.DisableItem(nWhich);
- }
+ if(!bEnabled)
+ rSet.DisableItem(nWhich);
+ }
break;
default:
nSlotId = 0; // don't know this slot
@@ -828,15 +828,20 @@ void SwDrawTextShell::ExecClpbrd(SfxRequest &rReq)
return;
OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
+
+ ESelection aSel(pOLV->GetSelection());
+ const sal_Bool bCopy = (aSel.nStartPara != aSel.nEndPara) || (aSel.nStartPos != aSel.nEndPos);
sal_uInt16 nId = rReq.GetSlot();
switch( nId )
{
case SID_CUT:
- pOLV->Cut();
+ if (bCopy)
+ pOLV->Cut();
return;
case SID_COPY:
- pOLV->Copy();
+ if (bCopy)
+ pOLV->Copy();
return;
case SID_PASTE:
@@ -888,8 +893,8 @@ void SwDrawTextShell::StateClpbrd(SfxItemSet &rSet)
}
break;
- case FN_PASTESPECIAL:
- rSet.DisableItem( FN_PASTESPECIAL );
+ case SID_PASTE_SPECIAL:
+ rSet.DisableItem( SID_PASTE_SPECIAL );
break;
// --> OD 2008-06-20 #151110#
case SID_CLIPBOARD_FORMAT_ITEMS:
diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx
index fd777d3..ad6ab1d 100644
--- a/sw/source/ui/shells/drwtxtsh.cxx
+++ b/sw/source/ui/shells/drwtxtsh.cxx
@@ -640,6 +640,7 @@ void SwDrawTextShell::ExecUndo(SfxRequest &rReq)
pUndoManager->Redo(0);
}
bCallBase = FALSE;
+ GetView().GetViewFrame()->GetBindings().InvalidateAll(sal_False);
}
break;
}
diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx
index c6b6be2..385cfde 100644
--- a/sw/source/ui/uiview/pview.cxx
+++ b/sw/source/ui/uiview/pview.cxx
@@ -1580,6 +1580,10 @@ void SwPagePreView::GetState( SfxItemSet& rSet )
{
switch(nWhich)
{
+ case SID_BROWSER_MODE:
+ case FN_PRINT_LAYOUT:
+ rSet.DisableItem(nWhich);
+ break;
case FN_START_OF_DOCUMENT:
{
if ( pPagePrevwLay->IsPageVisible( 1 ) )
@@ -2491,6 +2495,10 @@ SfxPrinter* SwPagePreView::GetPrinter( BOOL bCreate )
USHORT SwPagePreView::SetPrinter( SfxPrinter *pNew, USHORT nDiffFlags, bool )
{
ViewShell &rSh = *GetViewShell();
+ SfxPrinter* pOld = rSh.getIDocumentDeviceAccess()->getPrinter( false );
+ if ( pOld && pOld->IsPrinting() )
+ return SFX_PRINTERROR_BUSY;
+
SwEditShell &rESh = (SwEditShell&)rSh; //Buh...
if( ( SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP ) & nDiffFlags )
{
diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx
index 24eca08..5653071 100644
--- a/sw/source/ui/uiview/srcview.cxx
+++ b/sw/source/ui/uiview/srcview.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
@@ -57,6 +57,7 @@
#include <sfx2/app.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/viewfrm.hxx>
+#include <sfx2/bindings.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/fcontnr.hxx>
#include <sfx2/request.hxx>
@@ -457,17 +458,21 @@ void SwSrcView::Execute(SfxRequest& rReq)
break;
case SID_UNDO:
pTextView->Undo();
+ GetViewFrame()->GetBindings().InvalidateAll(FALSE);
break;
case SID_REDO:
pTextView->Redo();
+ GetViewFrame()->GetBindings().InvalidateAll(FALSE);
break;
case SID_REPEAT:
break;
case SID_CUT:
- pTextView->Cut();
+ if(pTextView->HasSelection())
+ pTextView->Cut();
break;
case SID_COPY:
- pTextView->Copy();
+ if(pTextView->HasSelection())
+ pTextView->Copy();
break;
case SID_PASTE:
pTextView->Paste();
@@ -588,6 +593,8 @@ void SwSrcView::GetState(SfxItemSet& rSet)
case SID_DIRECTEXPORTDOCASPDF:
case SID_EXPORTDOC:
case SID_REPEAT:
+ case SID_BROWSER_MODE:
+ case FN_PRINT_LAYOUT:
rSet.DisableItem(nWhich);
break;
case SID_CUT:
@@ -731,6 +738,10 @@ USHORT SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem,
USHORT SwSrcView::SetPrinter(SfxPrinter* pNew, USHORT nDiffFlags, bool )
{
SwDocShell* pDocSh = GetDocShell();
+ SfxPrinter* pOld = pDocSh->GetDoc()->getPrinter( false );
+ if ( pOld && pOld->IsPrinting() )
+ return SFX_PRINTERROR_BUSY;
+
if ( (SFX_PRINTER_JOBSETUP | SFX_PRINTER_PRINTER) & nDiffFlags )
{
pDocSh->GetDoc()->setPrinter( pNew, true, true );
@@ -865,7 +876,7 @@ SfxPrinter* SwSrcView::GetPrinter( BOOL bCreate )
void SwSrcView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
if ( rHint.ISA(SfxSimpleHint) &&
- (
+ (
((SfxSimpleHint&) rHint).GetId() == SFX_HINT_MODECHANGED ||
(
((SfxSimpleHint&) rHint).GetId() == SFX_HINT_TITLECHANGED &&
diff --git a/sw/source/ui/uiview/uivwimp.cxx b/sw/source/ui/uiview/uivwimp.cxx
index f6feb0e..1930856 100644
--- a/sw/source/ui/uiview/uivwimp.cxx
+++ b/sw/source/ui/uiview/uivwimp.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
@@ -335,48 +335,14 @@ void SAL_CALL SwClipboardChangeListener::changedContents( const CLIP_NMSPC::Clip
SfxBindings& rBind = pView->GetViewFrame()->GetBindings();
rBind.Invalidate( SID_PASTE );
- rBind.Invalidate( FN_PASTESPECIAL );
+ rBind.Invalidate( SID_PASTE_SPECIAL );
rBind.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
}
}
void SwClipboardChangeListener::AddRemoveListener( BOOL bAdd )
{
- try
- {
- do {
-
-#ifdef _DONT_WORD_FOR_WEBTOP_
-JP 4.7.2001: change for WebTop - get Clipboard from the Window.
- Reference< XMultiServiceFactory > xFact(
- ::comphelper::getProcessServiceFactory() );
- if( !xFact.is() )
- break;
- Reference< XClipboard > xClipboard( xFact->createInstance(
- ::rtl::OUString::createFromAscii(
- "com.sun.star.datatransfer.clipboard.SystemClipboard" )),
- UNO_QUERY );
-#else
- Reference< XClipboard > xClipboard(
- pView->GetEditWin().GetClipboard() );
-#endif
- if( !xClipboard.is() )
- break;
-
- Reference< XClipboardNotifier > xClpbrdNtfr( xClipboard, UNO_QUERY );
- if( xClpbrdNtfr.is() )
- {
- Reference< XClipboardListener > xClipEvtLstnr( this );
- if( bAdd )
- xClpbrdNtfr->addClipboardListener( xClipEvtLstnr );
- else
- xClpbrdNtfr->removeClipboardListener( xClipEvtLstnr );
- }
- } while ( FALSE );
- }
- catch( const uno::Exception& )
- {
- }
+ pView->AddRemoveClipboardListener( Reference< XClipboardListener >( this ), bAdd );
}
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index 3506e86..191ff8a 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -624,7 +624,7 @@ void SwView::_CheckReadonlyState()
SID_UNDO,
SID_REDO, SID_REPEAT, SID_PASTE,
SID_PASTE_UNFORMATTED,
- FN_PASTESPECIAL, SID_SBA_BRW_INSERT,
+ SID_PASTE_SPECIAL, SID_SBA_BRW_INSERT,
SID_BACKGROUND_COLOR, FN_INSERT_BOOKMARK,
SID_CHARMAP, FN_INSERT_SOFT_HYPHEN,
FN_INSERT_HARDHYPHEN, FN_INSERT_HARD_SPACE, FN_INSERT_BREAK,
@@ -1422,7 +1422,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
{
pValue->Value >>= bSelectedFrame;
bGotIsSelectedFrame = sal_True;
- }
+ }
pValue++;
}
if (bGotVisibleBottom)
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index 41a9ada..493daab 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -650,7 +650,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
break;
case FN_REDLINE_ACCEPT_DIRECT:
case FN_REDLINE_REJECT_DIRECT:
- {
+ {
SwContentAtPos aCntntAtPos( SwContentAtPos::SW_REDLINE );
Point aCrsrPos = pWrtShell->GetCrsrDocPos( sal_True );
if( pWrtShell->GetContentAtPos( aCrsrPos, aCntntAtPos ) )
@@ -1067,23 +1067,23 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
}
break;
case SID_RECHECK_DOCUMENT:
- {
+ {
SwDocShell* pDocShell = GetDocShell();
SwDoc* pDoc = pDocShell->GetDoc();
uno::Reference< linguistic2::XProofreadingIterator > xGCIterator( pDoc->GetGCIterator() );
if( xGCIterator.is() )
{
xGCIterator->resetIgnoreRules();
- }
+ }
// reset ignore lists
pDoc->SpellItAgainSam( sal_True, sal_False, sal_False );
- // clear ignore dictionary
+ // clear ignore dictionary
uno::Reference< linguistic2::XDictionary > xDictionary( SvxGetIgnoreAllList(), uno::UNO_QUERY );
if( xDictionary.is() )
xDictionary->clear();
// put cursor to the start of the document
pWrtShell->SttDoc();
- }
+ }
// no break; - but call spell/grammar dialog
case FN_SPELL_GRAMMAR_DIALOG:
{
@@ -1233,7 +1233,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
if (nPageCnt != nCnt) // Basic benachrichtigen
{
nPageCnt = nCnt;
- SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_PAGE_COUNT, GetViewFrame()->GetObjectShell()), FALSE);
+ SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_PAGE_COUNT, SwDocShell::GetEventName(STR_SW_EVENT_PAGE_COUNT), GetViewFrame()->GetObjectShell()), FALSE);
}
}
break;
@@ -1404,7 +1404,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
}
}
}
-
+
//#outline level, removed by zhaojianwei
//const SwNumRule* pNumRule = rShell.GetCurNumRule();
//if (pNumRule) // Cursor in Numerierung
@@ -1443,11 +1443,11 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
// }
//}//<-removed end ,zhaojianwei
- //-->#outline level,added by zhaojianwei
+ //-->#outline level,added by zhaojianwei
const SwNumRule* pNumRule = rShell.GetCurNumRule();
const bool bOutlineNum = pNumRule ? pNumRule->IsOutlineRule() : 0;
//((SwTxtFmtColl*)rShell.GetCrsr()->GetNode()->GetTxtNode()->GetFmtColl())->IsAssignedToListLevelOfOutlineStyle();
-
+
if (pNumRule && !bOutlineNum ) // Cursor in Numerierung
{
BYTE nNumLevel = rShell.GetNumLevel();
@@ -1481,9 +1481,9 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
}
}
}
- if( sStr.Len() )
+ if( sStr.Len() )
sStr.AppendAscii(sStatusDelim);
- sStr += SW_RESSTR(STR_NUM_LEVEL);
+ sStr += SW_RESSTR(STR_NUM_LEVEL);
sStr += String::CreateFromInt32( nNumLevel + 1 );
}
@@ -1495,9 +1495,9 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
sStr.AppendAscii(sStatusComma);
if( bOutlineNum )
{
- sStr += SW_RESSTR(STR_OUTLINE_NUMBERING);
+ sStr += SW_RESSTR(STR_OUTLINE_NUMBERING);
sStr.AppendAscii(sStatusDelim);
- sStr += SW_RESSTR(STR_NUM_LEVEL);
+ sStr += SW_RESSTR(STR_NUM_LEVEL);
}
else
sStr += SW_RESSTR(STR_NUM_OUTLINE);
@@ -2469,8 +2469,8 @@ IMPL_LINK( SwView, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg )
}
void SwView::ExecuteScan( SfxRequest& rReq )
-{
- if (pViewImpl)
+{
+ if (pViewImpl)
pViewImpl->ExecuteScan(rReq) ;
}
diff --git a/sw/source/ui/uiview/viewprt.cxx b/sw/source/ui/uiview/viewprt.cxx
index 443eee3..4f3870c 100644
--- a/sw/source/ui/uiview/viewprt.cxx
+++ b/sw/source/ui/uiview/viewprt.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
@@ -141,6 +141,10 @@ void SetPrinter( IDocumentDeviceAccess* pIDDA, SfxPrinter* pNew, BOOL bWeb )
USHORT __EXPORT SwView::SetPrinter(SfxPrinter* pNew, USHORT nDiffFlags, bool )
{
SwWrtShell &rSh = GetWrtShell();
+ SfxPrinter* pOld = rSh.getIDocumentDeviceAccess()->getPrinter( false );
+ if ( pOld && pOld->IsPrinting() )
+ return SFX_PRINTERROR_BUSY;
+
if ( (SFX_PRINTER_JOBSETUP | SFX_PRINTER_PRINTER) & nDiffFlags )
{
rSh.getIDocumentDeviceAccess()->setPrinter( pNew, true, true );
@@ -231,12 +235,12 @@ ErrCode SwView::DoPrint( SfxPrinter *pPrinter, PrintDialog *pDlg, BOOL bSilent,
SwPrtOptions aOpts( sDocumentTitle );
BOOL bWeb = 0 != PTR_CAST(SwWebView, this);
nMergeType = pMgr->GetMergeType();
-
+
BOOL bPrtPros;
BOOL bPrtPros_RTL;
SwView::MakeOptions( pDlg, aOpts, &bPrtPros, &bPrtPros_RTL, bWeb, GetPrinter(),
pSh->getIDocumentDeviceAccess()->getPrintData() );
-
+
//set the appropriate view options to print
//on silent mode the field commands have to be switched off always
//on default print the user is asked what to do
@@ -259,7 +263,7 @@ ErrCode SwView::DoPrint( SfxPrinter *pPrinter, PrintDialog *pDlg, BOOL bSilent,
//switch off display of hidden characters if on and hidden characters are in use
const sal_Bool bOldShowHiddenChar = pCurrentViewOptions->IsShowHiddenChar();
const sal_Bool bOldMetaChars = pCurrentViewOptions->IsViewMetaChars();
- if( bOldShowHiddenChar != aOpts.IsPrintHiddenText()
+ if( bOldShowHiddenChar != aOpts.IsPrintHiddenText()
&& pSh->GetDoc()->ContainsHiddenChars())
bApplyViewOptions |= true;
//switch off display of hidden paragraphs if on and hidden paragraphs are in use
@@ -294,7 +298,7 @@ ErrCode SwView::DoPrint( SfxPrinter *pPrinter, PrintDialog *pDlg, BOOL bSilent,
SW_MOD()->ApplyUsrPref(*pOrgViewOption, this, VIEWOPT_DEST_VIEW_ONLY );
}
-
+
if( nMergeType == DBMGR_MERGE_MAILMERGE ||
DBMGR_MERGE_DOCUMENTS == nMergeType )
{
@@ -431,9 +435,19 @@ ErrCode SwView::DoPrint( SfxPrinter *pPrinter, PrintDialog *pDlg, BOOL bSilent,
}
pProgress->Stop();
- pProgress->DeleteOnEndPrint();
- pPrinter->EndJob();
- return pPrinter->GetError();
+ if ( pPrinter->IsJobActive() )
+ {
+ pProgress->DeleteOnEndPrint();
+ pPrinter->EndJob();
+ return pPrinter->GetError();
+ }
+ else
+ {
+ // the next call might destroy pPrinter (in case it is not the usual document printer); so get the error before
+ ULONG nError = pPrinter->GetError();
+ pProgress->DeleteOnEndPrint();
+ return nError;
+ }
}
diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx
index 2679791..ce1e099 100644
--- a/sw/source/ui/uno/unomailmerge.cxx
+++ b/sw/source/ui/uno/unomailmerge.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
@@ -830,9 +830,9 @@ uno::Any SAL_CALL SwXMailMerge::execute(
DBG_ASSERT( !pOldSrc || pOldSrc == this, "Ooops... different event source already set." );
pMgr->SetMailMergeEvtSrc( this ); // launch events for listeners
- SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, xCurDocSh));
+ SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE), xCurDocSh));
BOOL bSucc = pMgr->MergeNew( aMergeDesc );
- SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE_END, xCurDocSh));
+ SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE_END, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE_END), xCurDocSh));
pMgr->SetMailMergeEvtSrc( pOldSrc );
diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx
index e83919e..21f1882 100644
--- a/sw/source/ui/wrtsh/select.cxx
+++ b/sw/source/ui/wrtsh/select.cxx
@@ -73,6 +73,13 @@ using namespace ::com::sun::star::util;
static long nStartDragX = 0, nStartDragY = 0;
static BOOL bStartDrag = FALSE;
+void SwWrtShell::Invalidate()
+{
+ // to avoid making the slot volatile, invalidate it everytime if something could have been changed
+ // this is still much cheaper than asking for the state every 200 ms (and avoid background processing)
+ GetView().GetViewFrame()->GetBindings().Invalidate( FN_STAT_SELMODE );
+}
+
BOOL SwWrtShell::SelNearestWrd()
{
MV_KONTEXT(this);
@@ -375,6 +382,7 @@ long SwWrtShell::ResetSelect(const Point *,BOOL)
*/
GetChgLnk().Call(this);
}
+ Invalidate();
SwTransferable::ClearSelection( *this );
return 1;
}
@@ -409,6 +417,7 @@ void SwWrtShell::SttSelect()
fnKillSel = &SwWrtShell::Ignore;
fnSetCrsr = &SwWrtShell::SetCrsr;
bInSelect = TRUE;
+ Invalidate();
SwTransferable::CreateSelection( *this );
}
/*
@@ -577,6 +586,7 @@ void SwWrtShell::EnterStdMode()
fnKillSel = &SwWrtShell::ResetSelect;
}
}
+ Invalidate();
SwTransferable::ClearSelection( *this );
}
@@ -655,6 +665,7 @@ void SwWrtShell::EnterAddMode()
bExtMode = FALSE;
if(SwCrsrShell::HasSelection())
CreateCrsr();
+ Invalidate();
}
@@ -665,6 +676,7 @@ void SwWrtShell::LeaveAddMode()
fnKillSel = &SwWrtShell::ResetSelect;
fnSetCrsr = &SwWrtShell::SetCrsrKillSel;
bAddMode = FALSE;
+ Invalidate();
}
/*
@@ -677,6 +689,7 @@ void SwWrtShell::EnterBlockMode()
EnterStdMode();
bBlockMode = TRUE;
CrsrToBlockCrsr();
+ Invalidate();
}
@@ -686,6 +699,7 @@ void SwWrtShell::LeaveBlockMode()
bBlockMode = FALSE;
BlockCrsrToCrsr();
EndSelect();
+ Invalidate();
}
// Einfuegemodus
@@ -700,6 +714,7 @@ void SwWrtShell::SetInsMode( BOOL bOn )
GetView().GetViewFrame()->GetBindings().SetState( aTmp );
StartAction();
EndAction();
+ Invalidate();
}
//Overwrite mode is incompatible with red-lining
void SwWrtShell::SetRedlineModeAndCheckInsMode( USHORT eMode )
@@ -744,6 +759,7 @@ void SwWrtShell::EnterSelFrmMode(const Point *pPos)
fnDrag = &SwWrtShell::BeginFrmDrag;
fnEndDrag = &SwWrtShell::UpdateLayoutFrm;
SwBaseShell::SetFrmMode( FLY_DRAG_START, this );
+ Invalidate();
}
@@ -756,6 +772,7 @@ void SwWrtShell::LeaveSelFrmMode()
bStartDrag = FALSE;
Edit();
SwBaseShell::SetFrmMode( FLY_DRAG_END, this );
+ Invalidate();
}
/*------------------------------------------------------------------------
Beschreibung: Rahmengebundenes Macro ausfuehren
@@ -799,6 +816,7 @@ long SwWrtShell::UpdateLayoutFrm(const Point *pPt, BOOL )
long SwWrtShell::ToggleAddMode()
{
bAddMode ? LeaveAddMode(): EnterAddMode();
+ Invalidate();
return !bAddMode;
}
@@ -806,6 +824,7 @@ long SwWrtShell::ToggleAddMode()
long SwWrtShell::ToggleBlockMode()
{
bBlockMode ? LeaveBlockMode(): EnterBlockMode();
+ Invalidate();
return !bBlockMode;
}
@@ -813,6 +832,7 @@ long SwWrtShell::ToggleBlockMode()
long SwWrtShell::ToggleExtMode()
{
bExtMode ? LeaveExtMode() : EnterExtMode();
+ Invalidate();
return !bExtMode;
}
/*
More information about the ooo-build-commit
mailing list