diff options
Diffstat (limited to 'reportdesign/source/ui/dlg/Navigator.cxx')
-rw-r--r-- | reportdesign/source/ui/dlg/Navigator.cxx | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx index cca1a5a2fbdb..0c1760b8e48a 100644 --- a/reportdesign/source/ui/dlg/Navigator.cxx +++ b/reportdesign/source/ui/dlg/Navigator.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -62,8 +62,8 @@ #include <memory> #include <algorithm> -#define RID_SVXIMG_COLLAPSEDNODE (RID_FORMS_START + 2) -#define RID_SVXIMG_EXPANDEDNODE (RID_FORMS_START + 3) +#define RID_SVXIMG_COLLAPSEDNODE (RID_FORMS_START + 2) +#define RID_SVXIMG_EXPANDEDNODE (RID_FORMS_START + 3) #define DROP_ACTION_TIMER_INITIAL_TICKS 10 #define DROP_ACTION_TIMER_SCROLL_TICKS 3 #define DROP_ACTION_TIMER_TICK_BASE 10 @@ -121,7 +121,7 @@ class NavigatorTree : public ::cppu::BaseMutex , public SvTreeListBox , public reportdesign::ITraverseReport , public comphelper::OSelectionChangeListener - , public ::comphelper::OPropertyChangeListener + , public ::comphelper::OPropertyChangeListener { class UserData; friend class UserData; @@ -159,8 +159,8 @@ class NavigatorTree : public ::cppu::BaseMutex DROP_ACTION m_aDropActionType; OReportController& m_rController; SvLBoxEntry* m_pMasterReport; - SvLBoxEntry* m_pDragedEntry; - ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pReportListener; + SvLBoxEntry* m_pDragedEntry; + ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pReportListener; ::rtl::Reference< comphelper::OSelectionChangeMultiplexer> m_pSelectionListener; unsigned short m_nTimerCounter; @@ -171,12 +171,12 @@ class NavigatorTree : public ::cppu::BaseMutex NavigatorTree(const NavigatorTree&); void operator =(const NavigatorTree&); protected: - virtual void Command( const CommandEvent& rEvt ); + virtual void Command( const CommandEvent& rEvt ); // DragSourceHelper overridables - virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ); + virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ); // DropTargetHelper overridables - virtual sal_Int8 AcceptDrop( const AcceptDropEvent& _rEvt ); - virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& _rEvt ); + virtual sal_Int8 AcceptDrop( const AcceptDropEvent& _rEvt ); + virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& _rEvt ); // OSelectionChangeListener virtual void _disposing(const lang::EventObject& _rSource) throw( uno::RuntimeException); @@ -205,7 +205,7 @@ public: virtual void traverseReportFooter(const uno::Reference< report::XSection>& _xSection); virtual void traversePageHeader(const uno::Reference< report::XSection>& _xSection); virtual void traversePageFooter(const uno::Reference< report::XSection>& _xSection); - + virtual void traverseGroups(const uno::Reference< report::XGroups>& _xGroups); virtual void traverseGroup(const uno::Reference< report::XGroup>& _xGroup); virtual void traverseGroupFunctions(const uno::Reference< report::XFunctions>& _xFunctions); @@ -232,7 +232,7 @@ NavigatorTree::NavigatorTree( Window* pParent,OReportController& _rController ) ,m_pDragedEntry(NULL) ,m_nTimerCounter( DROP_ACTION_TIMER_INITIAL_TICKS ) { - DBG_CTOR(rpt_NavigatorTree,NULL); + DBG_CTOR(rpt_NavigatorTree,NULL); m_pReportListener = new OPropertyChangeMultiplexer(this,m_rController.getReportDefinition().get()); m_pReportListener->addProperty(PROPERTY_PAGEHEADERON); m_pReportListener->addProperty(PROPERTY_PAGEFOOTERON); @@ -277,7 +277,7 @@ NavigatorTree::~NavigatorTree() } m_pReportListener->dispose(); m_pSelectionListener->dispose(); - DBG_DTOR(rpt_NavigatorTree,NULL); + DBG_DTOR(rpt_NavigatorTree,NULL); } //------------------------------------------------------------------------------ void NavigatorTree::Command( const CommandEvent& rEvt ) @@ -317,14 +317,14 @@ void NavigatorTree::Command( const CommandEvent& rEvt ) sal_Bool bDeleteAllowed = m_rController.isEditable() && (xGroup.is() || uno::Reference< report::XFunction>(pData->getContent(),uno::UNO_QUERY).is()); PopupMenu aContextMenu( ModuleRes( RID_MENU_NAVIGATOR ) ); - + USHORT nCount = aContextMenu.GetItemCount(); for (USHORT i = 0; i < nCount; ++i) { if ( MENUITEM_SEPARATOR != aContextMenu.GetItemType(i)) { USHORT nId = aContextMenu.GetItemId(i); - + aContextMenu.CheckItem(nId,m_rController.isCommandChecked(nId)); sal_Bool bEnabled = m_rController.isCommandEnabled(nId); if ( nId == SID_RPT_NEW_FUNCTION ) @@ -372,7 +372,7 @@ sal_Int8 NavigatorTree::AcceptDrop( const AcceptDropEvent& _rEvt ) { if (m_aDropActionTimer.IsActive()) m_aDropActionTimer.Stop(); - } + } else { bool bNeedTrigger = false; @@ -381,14 +381,14 @@ sal_Int8 NavigatorTree::AcceptDrop( const AcceptDropEvent& _rEvt ) { m_aDropActionType = DA_SCROLLUP; bNeedTrigger = true; - } + } else if ((aDropPos.Y() < GetSizePixel().Height()) && (aDropPos.Y() >= GetSizePixel().Height() - GetEntryHeight())) { m_aDropActionType = DA_SCROLLDOWN; bNeedTrigger = true; - } + } else - { + { SvLBoxEntry* pDropppedOn = GetEntry(aDropPos); if (pDropppedOn && (GetChildCount(pDropppedOn) > 0) && !IsExpanded(pDropppedOn)) { @@ -409,7 +409,7 @@ sal_Int8 NavigatorTree::AcceptDrop( const AcceptDropEvent& _rEvt ) m_aDropActionTimer.SetTimeout(DROP_ACTION_TIMER_TICK_BASE); m_aDropActionTimer.Start(); } - } + } else if (!bNeedTrigger) m_aDropActionTimer.Stop(); } @@ -480,8 +480,8 @@ IMPL_LINK(NavigatorTree, OnEntrySelDesel, NavigatorTree*, /*pThis*/) aSelection <<= static_cast<UserData*>(pEntry->GetUserData())->getContent(); m_rController.select(aSelection); m_pSelectionListener->unlock(); - } - + } + return 0L; } // ----------------------------------------------------------------------------- @@ -699,7 +699,7 @@ void NavigatorTree::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) } } // ----------------------------------------------------------------------------- -void NavigatorTree::_elementInserted( const container::ContainerEvent& _rEvent ) +void NavigatorTree::_elementInserted( const container::ContainerEvent& _rEvent ) { SvLBoxEntry* pEntry = find(_rEvent.Source); uno::Reference<beans::XPropertySet> xProp(_rEvent.Element,uno::UNO_QUERY_THROW); @@ -780,13 +780,13 @@ void NavigatorTree::removeEntry(SvLBoxEntry* _pEntry,bool _bRemove) } DBG_NAME(rpt_NavigatorTree_UserData) // ----------------------------------------------------------------------------- -NavigatorTree::UserData::UserData(NavigatorTree* _pTree,const uno::Reference<uno::XInterface>& _xContent) +NavigatorTree::UserData::UserData(NavigatorTree* _pTree,const uno::Reference<uno::XInterface>& _xContent) : OPropertyChangeListener(m_aMutex) , OContainerListener(m_aMutex) , m_xContent(_xContent) , m_pTree(_pTree) { - DBG_CTOR(rpt_NavigatorTree_UserData,NULL); + DBG_CTOR(rpt_NavigatorTree_UserData,NULL); uno::Reference<beans::XPropertySet> xProp(m_xContent,uno::UNO_QUERY); if ( xProp.is() ) { @@ -817,7 +817,7 @@ NavigatorTree::UserData::UserData(NavigatorTree* _pTree,const uno::Reference<uno // ----------------------------------------------------------------------------- NavigatorTree::UserData::~UserData() { - DBG_DTOR(rpt_NavigatorTree_UserData,NULL); + DBG_DTOR(rpt_NavigatorTree_UserData,NULL); if ( m_pContainerListener.is() ) m_pContainerListener->dispose(); if ( m_pListener.is() ) @@ -844,7 +844,7 @@ void NavigatorTree::UserData::_propertyChanged(const beans::PropertyChangeEvent& pMemFunSection = ::std::mem_fun(&OGroupHelper::getFooter); nPos = m_pTree->GetChildCount(pEntry) - 1; } - + OGroupHelper aGroupHelper(xGroup); if ( pIsOn(&aGroupHelper) ) { @@ -902,11 +902,11 @@ public: virtual ~ONavigatorImpl(); uno::Reference< report::XReportDefinition> m_xReport; - ::rptui::OReportController& m_rController; + ::rptui::OReportController& m_rController; ::std::auto_ptr<NavigatorTree> m_pNavigatorTree; }; -ONavigatorImpl::ONavigatorImpl(OReportController& _rController,ONavigator* _pParent) +ONavigatorImpl::ONavigatorImpl(OReportController& _rController,ONavigator* _pParent) :m_xReport(_rController.getReportDefinition()) ,m_rController(_rController) ,m_pNavigatorTree(new NavigatorTree(_pParent,_rController)) @@ -936,7 +936,7 @@ ONavigator::ONavigator( Window* _pParent DBG_CTOR( rpt_ONavigator,NULL); m_pImpl.reset(new ONavigatorImpl(_rController,this)); - + //Size aSpace = LogicToPixel( Size( 7, 120), MAP_APPFONT ); //Size aOutSize(nMaxTextWidth + m_aHeader.GetSizePixel().Width() + 3*aSpace.Width(),aSpace.Height()); //SetMinOutputSizePixel(aOutSize); @@ -946,14 +946,14 @@ ONavigator::ONavigator( Window* _pParent m_pImpl->m_pNavigatorTree->GrabFocus(); SetSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y)); Show(); - + } // ----------------------------------------------------------------------------- //------------------------------------------------------------------------ ONavigator::~ONavigator() { - DBG_DTOR( rpt_ONavigator,NULL); + DBG_DTOR( rpt_ONavigator,NULL); } //------------------------------------------------------------------------------ void ONavigator::Resize() |