summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2010-06-04 14:23:34 +0200
committerIvo Hinkelmann <ihi@openoffice.org>2010-06-04 14:23:34 +0200
commit3bd3fc177eebc1cc2779c5b77cbbe90014f9afe3 (patch)
treea7d85027d5fdb1d8d35e866bc76ab484dbd602f5 /sw/source/ui
parent5eec8358a4d83400fd74ce4ad74382355009d771 (diff)
parenta0d0dd7ae3feaf4de3d70957c20bb1fcf22525bf (diff)
CWS-TOOLING: integrate CWS dba33f
Notes
Notes: split repo tag: writer_ooo/DEV300_m81
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/app/apphdl.cxx1
-rw-r--r--sw/source/ui/inc/view.hxx1
-rw-r--r--sw/source/ui/shells/txtcrsr.cxx36
-rw-r--r--sw/source/ui/uno/unotxvw.cxx2
4 files changed, 39 insertions, 1 deletions
diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx
index c78d422a397c..0a844453bb3b 100644
--- a/sw/source/ui/app/apphdl.cxx
+++ b/sw/source/ui/app/apphdl.cxx
@@ -765,6 +765,7 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
DELETEZ(pWebToolbarConfig) ;
DELETEZ(pAuthorNames) ;
DELETEZ(pDBConfig);
+
if (pColorConfig != 0) {
pColorConfig->RemoveListener(this);
DELETEZ(pColorConfig);
diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx
index 7cff88c897cc..0c16e8bf132e 100644
--- a/sw/source/ui/inc/view.hxx
+++ b/sw/source/ui/inc/view.hxx
@@ -599,6 +599,7 @@ public:
SwDocShell *GetDocShell();
inline const SwDocShell *GetDocShell() const;
inline FmFormShell *GetFormShell() { return pFormShell; }
+ inline const FmFormShell *GetFormShell() const { return pFormShell; }
//damit in DToren der SubShells ggf. pShell zurueckgesetzt werden kann
void ResetSubShell() { pShell = 0; }
diff --git a/sw/source/ui/shells/txtcrsr.cxx b/sw/source/ui/shells/txtcrsr.cxx
index 8a72bb606e59..69f82ebf902d 100644
--- a/sw/source/ui/shells/txtcrsr.cxx
+++ b/sw/source/ui/shells/txtcrsr.cxx
@@ -47,6 +47,8 @@
#include <num.hxx>
#include <edtwin.hxx>
#include <crsskip.hxx>
+#include <doc.hxx>
+#include <docsh.hxx>
#ifndef _CMDID_H
#include <cmdid.h>
@@ -56,6 +58,10 @@
#include <globals.hrc>
#endif
+#include <svx/svdouno.hxx>
+#include <svx/fmshell.hxx>
+#include <svx/sdrobjectfilter.hxx>
+
using namespace ::com::sun::star;
void SwTextShell::ExecBasicMove(SfxRequest &rReq)
@@ -246,6 +252,36 @@ void SwTextShell::ExecMoveMisc(SfxRequest &rReq)
BOOL bSetRetVal = TRUE, bRet = TRUE;
switch ( nSlot )
{
+ case SID_FM_TOGGLECONTROLFOCUS:
+ {
+ const SwDoc* pDoc = rSh.GetDoc();
+ const SwDocShell* pDocShell = pDoc ? pDoc->GetDocShell() : NULL;
+ const SwView* pView = pDocShell ? pDocShell->GetView() : NULL;
+ const FmFormShell* pFormShell = pView ? pView->GetFormShell() : NULL;
+ SdrView* pDrawView = pView ? pView->GetDrawView() : NULL;
+ Window* pWindow = pView ? pView->GetWrtShell().GetWin() : NULL;
+
+ OSL_ENSURE( pFormShell && pDrawView && pWindow, "SwXTextView::ExecMoveMisc: no chance!" );
+ if ( !pFormShell || !pDrawView || !pWindow )
+ break;
+
+ ::std::auto_ptr< ::svx::ISdrObjectFilter > pFilter( pFormShell->CreateFocusableControlFilter(
+ *pDrawView, *pWindow ) );
+ if ( !pFilter.get() )
+ break;
+
+ const SdrObject* pNearestControl = rSh.GetBestObject( TRUE, GOTOOBJ_DRAW_CONTROL, FALSE, pFilter.get() );
+ if ( !pNearestControl )
+ break;
+
+ const SdrUnoObj* pUnoObject = dynamic_cast< const SdrUnoObj* >( pNearestControl );
+ OSL_ENSURE( pUnoObject, "SwTextShell::ExecMoveMisc: GetBestObject returned nonsense!" );
+ if ( !pUnoObject )
+ break;
+
+ pFormShell->ToggleControlFocus( *pUnoObject, *pDrawView, *pWindow );
+ }
+ break;
case FN_CNTNT_TO_NEXT_FRAME:
bRet = rSh.GotoObj(TRUE, GOTOOBJ_GOTO_ANY);
if(bRet)
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx
index 0504fb1107ad..1f1fc9149e34 100644
--- a/sw/source/ui/uno/unotxvw.cxx
+++ b/sw/source/ui/uno/unotxvw.cxx
@@ -710,7 +710,7 @@ uno::Reference< form::runtime::XFormController > SAL_CALL SwXTextView::getFormCo
FmFormShell* pFormShell = pView2 ? pView2->GetFormShell() : NULL;
SdrView* pDrawView = pView2 ? pView2->GetDrawView() : NULL;
Window* pWindow = pView2 ? pView2->GetWrtShell().GetWin() : NULL;
- DBG_ASSERT( pFormShell && pDrawView && pWindow, "SwXTextView::GetControl: how could I?" );
+ DBG_ASSERT( pFormShell && pDrawView && pWindow, "SwXTextView::getFormController: how could I?" );
uno::Reference< form::runtime::XFormController > xController;
if ( pFormShell && pDrawView && pWindow )