diff options
author | Noel Power <noel.power@novell.com> | 2012-08-01 18:25:32 +0100 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2012-09-28 17:27:23 +0100 |
commit | 815ac0a036ac023986598e6aa69e05c7d241b24e (patch) | |
tree | 69e3d4e22509f643eba898417968a614c52e1c1a | |
parent | n#782061 DOCX import: w:position should respect w:sz in w:rPrDefault (diff) | |
download | core-815ac0a036ac023986598e6aa69e05c7d241b24e.tar.gz core-815ac0a036ac023986598e6aa69e05c7d241b24e.zip |
add TabRatio api and detect macro at group shape fixes bnc#770708
Change-Id: I73eb612edaba21aa5bb07577b42bd31f8de2dd2a
-rw-r--r-- | oovbaapi/ooo/vba/excel/XWindow.idl | 1 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/fusel.cxx | 17 | ||||
-rw-r--r-- | sc/source/ui/inc/tabview.hxx | 4 | ||||
-rw-r--r-- | sc/source/ui/vba/vbawindow.cxx | 22 | ||||
-rw-r--r-- | sc/source/ui/vba/vbawindow.hxx | 2 |
5 files changed, 37 insertions, 9 deletions
diff --git a/oovbaapi/ooo/vba/excel/XWindow.idl b/oovbaapi/ooo/vba/excel/XWindow.idl index e22fa9b9e538..8670df313743 100644 --- a/oovbaapi/ooo/vba/excel/XWindow.idl +++ b/oovbaapi/ooo/vba/excel/XWindow.idl @@ -60,6 +60,7 @@ interface XWindow : com::sun::star::uno::XInterface [attribute, readonly] XRange VisibleRange; [attribute] any WindowState; [attribute] any Zoom; + [attribute] double TabRatio; any SelectedSheets( [in] any Index ); void SmallScroll( [in] any Down, [in] any Up, [in] any ToRight, [in] any ToLeft ); void LargeScroll( [in] any Down, [in] any Up, [in] any ToRight, [in] any ToLeft ); diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx index eec1dee833b2..e7432699197c 100644 --- a/sc/source/ui/drawfunc/fusel.cxx +++ b/sc/source/ui/drawfunc/fusel.cxx @@ -189,19 +189,22 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) // associated with the clicked object is used only // additionally you can also select a macro in Excel for a grouped - // objects and this results in the macro being set for the elements - // in the group and no macro is exported for the group - + // objects and this *usually* results in the macro being set + // for the elements in the group and no macro is exported + // for the group itself ( this however is not always true ) // if a macro and hlink are defined favour the hlink - // If a group object has no hyperlink use the hyperlink of the // object clicked if ( pObj->IsGroupObject() ) { - SdrObject* pHit = NULL; - if ( pView->PickObj(aMDPos, pView->getHitTolLog(), pHit, pPV, SDRSEARCH_DEEP ) ) - pObj = pHit; + ScMacroInfo* pTmpInfo = ScDrawLayer::GetMacroInfo( pObj ); + if ( !pTmpInfo || pTmpInfo->GetMacro().isEmpty() ) + { + SdrObject* pHit = NULL; + if ( pView->PickObj(aMDPos, pView->getHitTolLog(), pHit, pPV, SDRSEARCH_DEEP ) ) + pObj = pHit; + } } ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, true ); diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index 8879b07dbf43..2288480f4075 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -256,14 +256,14 @@ public: void SetTabBarWidth( long nNewWidth ); /** Sets a relative tab bar width. @param fRelTabBarWidth Tab bar width relative to frame window width (0.0 ... 1.0). */ - void SetRelTabBarWidth( double fRelTabBarWidth ); + SC_DLLPUBLIC void SetRelTabBarWidth( double fRelTabBarWidth ); /** Sets a relative tab bar width. Tab bar is resized again in next DoResize(). @param fRelTabBarWidth Tab bar width relative to frame window width (0.0 ... 1.0). */ void SetPendingRelTabBarWidth( double fRelTabBarWidth ); /** Returns the current tab bar width in pixels. */ long GetTabBarWidth() const; /** Returns the current tab bar width relative to the frame window width (0.0 ... 1.0). */ - double GetRelTabBarWidth() const; + SC_DLLPUBLIC double GetRelTabBarWidth() const; /** Returns the pending tab bar width relative to the frame window width (0.0 ... 1.0). */ double GetPendingRelTabBarWidth() const; diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx index f196a5c8fc3a..f56c79fc23b0 100644 --- a/sc/source/ui/vba/vbawindow.cxx +++ b/sc/source/ui/vba/vbawindow.cxx @@ -851,6 +851,28 @@ ScVbaWindow::PrintPreview( const css::uno::Any& EnableChanges ) throw (css::scri PrintPreviewHelper( EnableChanges, excel::getBestViewShell( m_xModel ) ); } +double SAL_CALL ScVbaWindow::getTabRatio() throw (css::uno::RuntimeException) +{ + ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); + if ( pViewShell && pViewShell->GetViewData() && pViewShell->GetViewData()->GetView() ) + { + double fRatio = pViewShell->GetViewData()->GetView()->GetRelTabBarWidth(); + if ( fRatio >= 0.0 && fRatio <= 1.0 ) + return fRatio; + } + return 0.0; +} + +void SAL_CALL ScVbaWindow::setTabRatio( double fRatio ) throw (css::uno::RuntimeException) +{ + ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); + if ( pViewShell && pViewShell->GetViewData() && pViewShell->GetViewData()->GetView() ) + { + if ( fRatio >= 0.0 && fRatio <= 1.0 ) + pViewShell->GetViewData()->GetView()->SetRelTabBarWidth( fRatio ); + } +} + rtl::OUString ScVbaWindow::getServiceImplName() { diff --git a/sc/source/ui/vba/vbawindow.hxx b/sc/source/ui/vba/vbawindow.hxx index 12b460aca441..f3d2d5075354 100644 --- a/sc/source/ui/vba/vbawindow.hxx +++ b/sc/source/ui/vba/vbawindow.hxx @@ -112,6 +112,8 @@ public: virtual void SAL_CALL setWindowState( const css::uno::Any& _windowstate ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getZoom() throw (css::uno::RuntimeException); virtual void SAL_CALL setZoom( const css::uno::Any& _zoom ) throw (css::uno::RuntimeException); + virtual double SAL_CALL getTabRatio() throw (css::uno::RuntimeException) ; + virtual void SAL_CALL setTabRatio( double _tabratio ) throw (css::uno::RuntimeException) ; // Methods virtual void SAL_CALL SmallScroll( const css::uno::Any& Down, const css::uno::Any& Up, const css::uno::Any& ToRight, const css::uno::Any& ToLeft ) throw (css::uno::RuntimeException); |