diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-09-09 11:45:13 +0200 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-09-09 11:45:13 +0200 |
commit | f088879bac7cb8149b116eea22a51cfb54012b3c (patch) | |
tree | 7fe914382ccef332b3c7579ba6dc09eeb8b3657f /basctl | |
parent | 78fe4e5d494327cd0d0ea21f1663b1722583629e (diff) | |
parent | b4f7e9e44292d81c4645e790545461943fb003c6 (diff) |
merge commit to DEV300_m57
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/basidesh.src | 2 | ||||
-rw-r--r-- | basctl/source/basicide/basobj2.cxx | 25 | ||||
-rw-r--r-- | basctl/source/basicide/bastype3.hxx | 18 | ||||
-rw-r--r-- | basctl/source/basicide/bastypes.cxx | 57 | ||||
-rw-r--r-- | basctl/source/basicide/moduldl2.cxx | 31 | ||||
-rw-r--r-- | basctl/source/basicide/moduldlg.hxx | 4 | ||||
-rw-r--r-- | basctl/source/dlged/dlgedobj.cxx | 101 | ||||
-rw-r--r-- | basctl/source/dlged/dlgedview.cxx | 66 | ||||
-rw-r--r-- | basctl/source/inc/basobj.hxx | 1 | ||||
-rw-r--r-- | basctl/source/inc/bastypes.hxx | 12 | ||||
-rw-r--r-- | basctl/source/inc/dlgedobj.hxx | 7 | ||||
-rw-r--r-- | basctl/source/inc/dlgedview.hxx | 5 | ||||
-rw-r--r-- | basctl/util/makefile.mk | 1 |
13 files changed, 73 insertions, 257 deletions
diff --git a/basctl/source/basicide/basidesh.src b/basctl/source/basicide/basidesh.src index 5d5f4b6fe9fb..130dda34d9e4 100644 --- a/basctl/source/basicide/basidesh.src +++ b/basctl/source/basicide/basidesh.src @@ -195,7 +195,7 @@ String RID_STR_APPENDLIBS String RID_STR_QUERYDELMACRO { /* ### ACHTUNG: Neuer Text in Resource? Mchten Sie das Makro XX lschen ? : Mchten Sie das Makro XX lschen ? */ - Text [ en-US ] = "Do you want to delete the macro XX ?" ; + Text [ en-US ] = "Do you want to delete the macro XX?" ; }; String RID_STR_QUERYDELDIALOG { diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx index 4d0ccca05581..e4abb3fad92e 100644 --- a/basctl/source/basicide/basobj2.cxx +++ b/basctl/source/basicide/basobj2.cxx @@ -80,31 +80,6 @@ namespace BasicIDE { //---------------------------------------------------------------------------- -SfxMacro* CreateMacro() -{ - DBG_ERROR( "BasicIDE::CreateMacro() - war eigentlich nur fuer Macro-Recording!" ); - IDE_DLL()->GetExtraData()->ChoosingMacro() = TRUE; - SFX_APP()->EnterBasicCall(); - Window* pParent = Application::GetDefDialogParent(); - SfxMacro* pMacro = 0; - MacroChooser* pChooser = new MacroChooser( pParent, TRUE ); - Window* pOldModalDialogParent = Application::GetDefDialogParent(); - Application::SetDefDialogParent( pChooser ); - //pChooser->SetMode( MACROCHOOSER_RECORDING ); - short nRetValue = pChooser->Execute(); - (void)nRetValue; - - Application::SetDefDialogParent( pOldModalDialogParent ); - delete pChooser; - - SFX_APP()->LeaveBasicCall(); - IDE_DLL()->GetExtraData()->ChoosingMacro() = FALSE; - - return pMacro; -} - -//---------------------------------------------------------------------------- - void Organize( INT16 tabId ) { BasicIDEDLL::Init(); diff --git a/basctl/source/basicide/bastype3.hxx b/basctl/source/basicide/bastype3.hxx index 35607b43f307..02dbb9cd95dd 100644 --- a/basctl/source/basicide/bastype3.hxx +++ b/basctl/source/basicide/bastype3.hxx @@ -62,24 +62,6 @@ public: Accelerator& GetAccelerator() { return aAcc; } }; -class ExtendedMultiLineEdit : public MultiLineEdit -{ -private: - Accelerator aAcc; - Link aAccHdl; - -protected: - DECL_LINK( EditAccHdl, Accelerator * ); - DECL_LINK( ImplGetFocusHdl, Control* ); - DECL_LINK( ImplLoseFocusHdl, Control* ); - -public: - ExtendedMultiLineEdit( Window* pParent, IDEResId nRes ); - - void SetAccHdl( const Link& rLink ) { aAccHdl = rLink; } - Accelerator& GetAccelerator() { return aAcc; } -}; - #endif //NO_SPECIALEDIT #endif // _BASTYPE3_HXX diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx index c00037cf8cab..3b64b11b9abc 100644 --- a/basctl/source/basicide/bastypes.cxx +++ b/basctl/source/basicide/bastypes.cxx @@ -484,24 +484,6 @@ void __EXPORT BasicDockingWindow::StartDocking() - -BasicToolBox::BasicToolBox( Window* pParent, IDEResId nRes ) : - ToolBox( pParent, nRes ) -{ -} - - - -void __EXPORT BasicToolBox::MouseButtonDown( const MouseEvent &rEvt ) -{ - ToolBox::MouseButtonDown( rEvt ); - if ( !GetCurItemId() ) - ((BasicDockingWindow*)GetParent())->MouseButtonDown( rEvt ); -} - - - - ExtendedEdit::ExtendedEdit( Window* pParent, IDEResId nRes ) : Edit( pParent, nRes ) { @@ -534,34 +516,6 @@ IMPL_LINK_INLINE_END( ExtendedEdit, EditAccHdl, Accelerator *, pAcc ) -ExtendedMultiLineEdit::ExtendedMultiLineEdit( Window* pParent, IDEResId nRes ) : - MultiLineEdit( pParent, nRes ) -{ - aAcc.SetSelectHdl( LINK( this, ExtendedMultiLineEdit, EditAccHdl ) ); - Control::SetGetFocusHdl( LINK( this, ExtendedMultiLineEdit, ImplGetFocusHdl ) ); - Control::SetLoseFocusHdl( LINK( this, ExtendedMultiLineEdit, ImplLoseFocusHdl ) ); -} - -IMPL_LINK( ExtendedMultiLineEdit, ImplGetFocusHdl, Control*, EMPTYARG ) -{ - Application::InsertAccel( &aAcc ); - return 0; -} - - -IMPL_LINK( ExtendedMultiLineEdit, ImplLoseFocusHdl, Control*, EMPTYARG ) -{ - Application::RemoveAccel( &aAcc ); - return 0; -} - -IMPL_LINK_INLINE_START( ExtendedMultiLineEdit, EditAccHdl, Accelerator *, pAcc ) -{ - aAccHdl.Call( pAcc ); - return 0; -} -IMPL_LINK_INLINE_END( ExtendedMultiLineEdit, EditAccHdl, Accelerator *, pAcc ) - struct TabBarDDInfo { ULONG npTabBar; @@ -803,11 +757,6 @@ ULONG CalcLineCount( SvStream& rStream ) return nCRs; } -LibInfoKey::LibInfoKey() - :m_aDocument( ScriptDocument::getApplicationScriptDocument() ) -{ -} - LibInfoKey::LibInfoKey( const ScriptDocument& rDocument, const String& rLibName ) :m_aDocument( rDocument ) ,m_aLibName( rLibName ) @@ -839,12 +788,6 @@ bool LibInfoKey::operator==( const LibInfoKey& rKey ) const return bRet; } -LibInfoItem::LibInfoItem() - :m_aDocument( ScriptDocument::getApplicationScriptDocument() ) - ,m_nCurrentType( 0 ) -{ -} - LibInfoItem::LibInfoItem( const ScriptDocument& rDocument, const String& rLibName, const String& rCurrentName, USHORT nCurrentType ) :m_aDocument( rDocument ) ,m_aLibName( rLibName ) diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index abf25722eab2..f0143cc8517b 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -232,14 +232,6 @@ SvLBoxEntry* BasicCheckBox::DoInsertEntry( const String& rStr, ULONG nPos ) //---------------------------------------------------------------------------- -void BasicCheckBox::RemoveEntry( ULONG nPos ) -{ - if ( nPos < GetEntryCount() ) - SvTreeListBox::GetModel()->Remove( GetEntry( nPos ) ); -} - -//---------------------------------------------------------------------------- - SvLBoxEntry* BasicCheckBox::FindEntry( const String& rName ) { ULONG nCount = GetEntryCount(); @@ -255,29 +247,6 @@ SvLBoxEntry* BasicCheckBox::FindEntry( const String& rName ) //---------------------------------------------------------------------------- -ULONG BasicCheckBox::GetSelectEntryPos() const -{ - return GetModel()->GetAbsPos( FirstSelected() ); -} - -//---------------------------------------------------------------------------- - -ULONG BasicCheckBox::GetCheckedEntryCount() const -{ - ULONG nCheckCount = 0; - ULONG nCount = GetEntryCount(); - - for (ULONG i=0; i<nCount; i++ ) - { - if ( IsChecked( i ) ) - nCheckCount++; - } - - return nCheckCount; -} - -//---------------------------------------------------------------------------- - void BasicCheckBox::CheckEntryPos( ULONG nPos, BOOL bCheck ) { if ( nPos < GetEntryCount() ) diff --git a/basctl/source/basicide/moduldlg.hxx b/basctl/source/basicide/moduldlg.hxx index 6d9a468fd498..b5066463ec51 100644 --- a/basctl/source/basicide/moduldlg.hxx +++ b/basctl/source/basicide/moduldlg.hxx @@ -131,12 +131,8 @@ public: ~BasicCheckBox(); SvLBoxEntry* DoInsertEntry( const String& rStr, ULONG nPos = LISTBOX_APPEND ); - void RemoveEntry( ULONG nPos ); SvLBoxEntry* FindEntry( const String& rName ); - ULONG GetSelectEntryPos() const; - - ULONG GetCheckedEntryCount() const; void CheckEntryPos( ULONG nPos, BOOL bCheck = TRUE ); BOOL IsChecked( ULONG nPos ) const; diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx index f8cec9ee785f..6211b8552bc3 100644 --- a/basctl/source/dlged/dlgedobj.cxx +++ b/basctl/source/dlged/dlgedobj.cxx @@ -88,16 +88,6 @@ DlgEdObj::DlgEdObj() //---------------------------------------------------------------------------- -DlgEdObj::DlgEdObj(const ::rtl::OUString& rModelName) - :SdrUnoObj(rModelName, sal_False) - ,bIsListening(sal_False) - ,pDlgEdForm( NULL ) -{ - DBG_CTOR(DlgEdObj, NULL); -} - -//---------------------------------------------------------------------------- - DlgEdObj::DlgEdObj(const ::rtl::OUString& rModelName, const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSFac) :SdrUnoObj(rModelName, rxSFac, sal_False) @@ -1377,76 +1367,11 @@ void DlgEdObj::SetLayer(SdrLayerID nLayer) //---------------------------------------------------------------------------- -SdrObject* DlgEdObj::CheckHit( const Point& rPnt, USHORT nTol,const SetOfByte* pSet ) const -{ - // #109994# fixed here, because the drawing layer doesn't handle objects - // with a width or height of 0 in a proper way - Rectangle aRect_( aOutRect ); - if ( aRect_.IsEmpty() ) - { - aRect_.Left() -= nTol; - aRect_.Top() -= nTol; - aRect_.Right() = ( aRect_.Right() == RECT_EMPTY ? aOutRect.Left() + nTol : aRect_.Right() + nTol ); - aRect_.Bottom() = ( aRect_.Bottom() == RECT_EMPTY ? aOutRect.Top() + nTol : aRect_.Bottom() + nTol ); - - if ( aRect_.IsInside( rPnt ) ) - return (SdrObject*)this; - else - return 0; - } - - if ( supportsService( "com.sun.star.awt.UnoControlGroupBoxModel" )) - { - Rectangle aROuter = aOutRect; - aROuter.Left() -= nTol; - aROuter.Right() += nTol; - aROuter.Top() -= nTol; - aROuter.Bottom() += nTol; - - Rectangle aRInner = aOutRect; - if( (aRInner.GetSize().Height() > (long)nTol*2) && - (aRInner.GetSize().Width() > (long)nTol*2) ) - { - aRInner.Left() += nTol; - aRInner.Right() -= nTol; - aRInner.Top() += nTol; - aRInner.Bottom() -= nTol; - } - - if( aROuter.IsInside( rPnt ) && !aRInner.IsInside( rPnt ) ) - return (SdrObject*)this; - else - return 0; - } - else - return SdrUnoObj::CheckHit( rPnt, nTol, pSet ); -} - - -//---------------------------------------------------------------------------- - TYPEINIT1(DlgEdForm, DlgEdObj); DBG_NAME(DlgEdForm); //---------------------------------------------------------------------------- -DlgEdForm::DlgEdForm(const ::rtl::OUString& rModelName) - :DlgEdObj(rModelName) -{ - DBG_CTOR(DlgEdForm, NULL); -} - -//---------------------------------------------------------------------------- - -DlgEdForm::DlgEdForm(const ::rtl::OUString& rModelName, - const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSFac) - :DlgEdObj(rModelName, rxSFac) -{ - DBG_CTOR(DlgEdForm, NULL); -} - -//---------------------------------------------------------------------------- - DlgEdForm::DlgEdForm() :DlgEdObj() { @@ -1857,32 +1782,6 @@ void DlgEdForm::UpdateTabOrderAndGroups() //---------------------------------------------------------------------------- -SdrObject* DlgEdForm::CheckHit( const Point& rPnt, USHORT nTol, const SetOfByte* ) const -{ - Rectangle aROuter = aOutRect; - aROuter.Left() -= nTol; - aROuter.Right() += nTol; - aROuter.Top() -= nTol; - aROuter.Bottom() += nTol; - - Rectangle aRInner = aOutRect; - if( (aRInner.GetSize().Height() > (long)nTol*2) && - (aRInner.GetSize().Width() > (long)nTol*2) ) - { - aRInner.Left() += nTol; - aRInner.Right() -= nTol; - aRInner.Top() += nTol; - aRInner.Bottom() -= nTol; - } - - if( aROuter.IsInside( rPnt ) && !aRInner.IsInside( rPnt ) ) - return (SdrObject*)this; - else - return 0; -} - -//---------------------------------------------------------------------------- - void DlgEdForm::NbcMove( const Size& rSize ) { SdrUnoObj::NbcMove( rSize ); diff --git a/basctl/source/dlged/dlgedview.cxx b/basctl/source/dlged/dlgedview.cxx index 50b7ae7f28df..19b58e763113 100644 --- a/basctl/source/dlged/dlgedview.cxx +++ b/basctl/source/dlged/dlgedview.cxx @@ -43,6 +43,7 @@ #include <basidesh.hxx> #include <iderdll.hxx> +#include "dlgedobj.hxx" TYPEINIT1( DlgEdView, SdrView ); @@ -151,3 +152,68 @@ void DlgEdView::MakeVisible( const Rectangle& rRect, Window& rWin ) //---------------------------------------------------------------------------- +SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, USHORT nTol) +{ + DlgEdObj* pDlgEdObj = dynamic_cast< DlgEdObj* >(pRetval); + + if(pDlgEdObj) + { + bool bExcludeInner(false); + + if(0 != dynamic_cast< DlgEdForm* >(pRetval)) + { + // from DlgEdForm::CheckHit; exclude inner for DlgEdForm + bExcludeInner = true; + } + else if(pDlgEdObj->supportsService("com.sun.star.awt.UnoControlGroupBoxModel")) + { + // from DlgEdObj::CheckHit; exclude inner for group shapes + bExcludeInner = true; + } + + if(bExcludeInner) + { + // use direct model data; it's a DlgEdObj, so GetLastBoundRect() + // will access aOutRect directly + const Rectangle aOuterRectangle(pDlgEdObj->GetLastBoundRect()); + + if(!aOuterRectangle.IsEmpty() + && RECT_EMPTY != aOuterRectangle.Right() + && RECT_EMPTY != aOuterRectangle.Bottom()) + { + basegfx::B2DRange aOuterRange( + aOuterRectangle.Left(), aOuterRectangle.Top(), + aOuterRectangle.Right(), aOuterRectangle.Bottom()); + + if(nTol) + { + aOuterRange.grow(-1.0 * nTol); + } + + if(aOuterRange.isInside(basegfx::B2DPoint(rPnt.X(), rPnt.Y()))) + { + pRetval = 0; + } + } + } + } + + return pRetval; +} + +SdrObject* DlgEdView::CheckSingleSdrObjectHit(const Point& rPnt, USHORT nTol, SdrObject* pObj, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay) const +{ + // call parent + SdrObject* pRetval = SdrView::CheckSingleSdrObjectHit(rPnt, nTol, pObj, pPV, nOptions, pMVisLay); + + if(pRetval) + { + // check hitted object locally + pRetval = impLocalHitCorrection(pRetval, rPnt, nTol); + } + + return pRetval; +} + +//---------------------------------------------------------------------------- +// eof diff --git a/basctl/source/inc/basobj.hxx b/basctl/source/inc/basobj.hxx index a243d64af39a..c917de5a6dee 100644 --- a/basctl/source/inc/basobj.hxx +++ b/basctl/source/inc/basobj.hxx @@ -54,7 +54,6 @@ struct BasicIDE_Impl; namespace BasicIDE { - SfxMacro* CreateMacro(); void Organize( INT16 tabId ); diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx index ba1ac9c57068..0c542ac405ad 100644 --- a/basctl/source/inc/bastypes.hxx +++ b/basctl/source/inc/bastypes.hxx @@ -98,8 +98,6 @@ struct BreakPoint class BasicDockingWindow : public DockingWindow { - friend class BasicToolBox; - Rectangle aFloatingPosAndSize; protected: @@ -113,14 +111,6 @@ public: BasicDockingWindow( Window* pParent ); }; -class BasicToolBox : public ToolBox -{ -public: - BasicToolBox( Window* pParent, IDEResId nRes ); - - virtual void MouseButtonDown( const MouseEvent& rMEvt ); -}; - DECLARE_LIST( BreakPL, BreakPoint* ) class BreakPointList : public BreakPL { @@ -264,7 +254,6 @@ private: String m_aLibName; public: - LibInfoKey(); LibInfoKey( const ScriptDocument& rDocument, const String& rLibName ); ~LibInfoKey(); @@ -287,7 +276,6 @@ private: USHORT m_nCurrentType; public: - LibInfoItem(); LibInfoItem( const ScriptDocument& rDocument, const String& rLibName, const String& rCurrentName, USHORT nCurrentType ); ~LibInfoItem(); diff --git a/basctl/source/inc/dlgedobj.hxx b/basctl/source/inc/dlgedobj.hxx index 6061eff2a8df..e352ad738da4 100644 --- a/basctl/source/inc/dlgedobj.hxx +++ b/basctl/source/inc/dlgedobj.hxx @@ -66,7 +66,6 @@ private: protected: DlgEdObj(); - DlgEdObj(const ::rtl::OUString& rModelName); DlgEdObj(const ::rtl::OUString& rModelName, const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSFac); @@ -140,7 +139,6 @@ public: virtual void SAL_CALL _elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException); virtual void SetLayer(SdrLayerID nLayer); - virtual SdrObject* CheckHit(const Point& rPnt,USHORT nTol,const SetOfByte*) const; }; @@ -161,9 +159,6 @@ private: protected: - DlgEdForm(const ::rtl::OUString& rModelName); - DlgEdForm(const ::rtl::OUString& rModelName, - const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSFac); DlgEdForm(); virtual void NbcMove( const Size& rSize ); @@ -194,8 +189,6 @@ public: virtual void UpdateGroups(); virtual void UpdateTabOrderAndGroups(); - virtual SdrObject* CheckHit(const Point& rPnt,USHORT nTol,const SetOfByte*) const; - ::com::sun::star::awt::DeviceInfo getDeviceInfo() const; private: diff --git a/basctl/source/inc/dlgedview.hxx b/basctl/source/inc/dlgedview.hxx index 5b9538c347f8..11d580634e99 100644 --- a/basctl/source/inc/dlgedview.hxx +++ b/basctl/source/inc/dlgedview.hxx @@ -53,6 +53,11 @@ public: virtual void MarkListHasChanged(); virtual void MakeVisible( const Rectangle& rRect, Window& rWin ); + +protected: + // overloaded to handle HitTest for some objects special + using SdrView::CheckSingleSdrObjectHit; + virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, USHORT nTol, SdrObject* pObj, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay) const; }; #endif //_BASCTL_DLGEDVIEW_HXX diff --git a/basctl/util/makefile.mk b/basctl/util/makefile.mk index 80b3efd4325d..0f2a919ff655 100644 --- a/basctl/util/makefile.mk +++ b/basctl/util/makefile.mk @@ -54,6 +54,7 @@ SHL1TARGET= basctl$(DLLPOSTFIX) SHL1IMPLIB= basctl SHL1BASE = 0x1d800000 SHL1STDLIBS= \ + $(SVXCORELIB) \ $(SVXLIB) \ $(SFX2LIB) \ $(BASICLIB) \ |