Kaydet (Commit) 3514df0f authored tarafından Noel Power's avatar Noel Power

add TabRatio api and detect macro at group shape fixes bnc#770708

Change-Id: I73eb612edaba21aa5bb07577b42bd31f8de2dd2a
üst 13dc61da
......@@ -51,6 +51,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 );
......
......@@ -186,19 +186,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 );
......
......@@ -255,14 +255,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;
......
......@@ -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()
{
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment