diff options
Diffstat (limited to 'sw/source/ui/uiview/view2.cxx')
-rw-r--r-- | sw/source/ui/uiview/view2.cxx | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index c48ad073411e..c063c72c5892 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -119,7 +119,7 @@ #include <pagedesc.hxx> #include <section.hxx> #include <usrpref.hxx> -#include <bookmrk.hxx> +#include <IMark.hxx> #include <navipi.hxx> #include <tox.hxx> #include <workctrl.hxx> @@ -1246,7 +1246,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) break; case SID_ATTR_ZOOM: { - if ( GetDocShell()->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) + if ( ( GetDocShell()->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) || !GetDocShell()->IsInPlaceActive() ) { const SwViewOption* pVOpt = rShell.GetViewOptions(); SvxZoomType eZoom = (SvxZoomType) pVOpt->GetZoomType(); @@ -1268,7 +1268,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) break; case SID_ATTR_VIEWLAYOUT: { - if ( GetDocShell()->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) + if ( ( GetDocShell()->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) || !GetDocShell()->IsInPlaceActive() ) { const SwViewOption* pVOpt = rShell.GetViewOptions(); const USHORT nColumns = pVOpt->GetViewLayoutColumns(); @@ -1282,7 +1282,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) break; case SID_ATTR_ZOOMSLIDER: { - if ( GetDocShell()->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) + if ( ( GetDocShell()->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) || !GetDocShell()->IsInPlaceActive() ) { const SwViewOption* pVOpt = rShell.GetViewOptions(); const USHORT nCurrentZoom = pVOpt->GetZoom(); @@ -1566,10 +1566,18 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) { if (SFX_ITEM_SET == pArgs->GetItemState( nWhich, TRUE, &pItem)) { - USHORT nDest; - nDest = ((const SfxUInt16Item *)pItem)->GetValue(); - rSh.EnterStdMode(); - rSh.GotoBookmark( nDest ); + const IDocumentMarkAccess* pMarkAccess = rSh.getIDocumentMarkAccess(); + const sal_Int32 nIdx = static_cast<const SfxUInt16Item*>(pItem)->GetValue(); + if(nIdx < pMarkAccess->getBookmarksCount()) + { + const IDocumentMarkAccess::const_iterator_t ppBookmark = rSh.getIDocumentMarkAccess()->getBookmarksBegin() + nIdx; + rSh.EnterStdMode(); + rSh.GotoMark( ppBookmark->get() ); + } + else + OSL_ENSURE(false, + "SwView::ExecuteStatusLine(..)" + " - Ignoring out of range bookmark index"); } } break; @@ -1582,13 +1590,13 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) break; case SID_ATTR_ZOOM: { - if ( GetDocShell()->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) + if ( ( GetDocShell()->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) || !GetDocShell()->IsInPlaceActive() ) { const SfxItemSet *pSet = 0; AbstractSvxZoomDialog *pDlg = 0; if ( pArgs ) pSet = pArgs; - else if ( GetDocShell()->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) + else { const SwViewOption& rViewOptions = *rSh.GetViewOptions(); SfxItemSet aCoreSet(pShell->GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM, SID_ATTR_VIEWLAYOUT, SID_ATTR_VIEWLAYOUT, 0 ); @@ -1653,7 +1661,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) case SID_ATTR_VIEWLAYOUT: { if ( pArgs && !rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) && - GetDocShell()->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) + ( ( GetDocShell()->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) || !GetDocShell()->IsInPlaceActive() ) ) { // PAGES01 if ( SFX_ITEM_SET == pArgs->GetItemState(SID_ATTR_VIEWLAYOUT, TRUE, &pItem )) @@ -1676,7 +1684,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) case SID_ATTR_ZOOMSLIDER: { - if ( pArgs && GetDocShell()->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) + if ( pArgs && ( ( GetDocShell()->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) || !GetDocShell()->IsInPlaceActive() ) ) { // PAGES01 if ( SFX_ITEM_SET == pArgs->GetItemState(SID_ATTR_ZOOMSLIDER, TRUE, &pItem )) @@ -1871,6 +1879,8 @@ BOOL SwView::JumpToSwMark( const String& rMark ) sMark.Search( cMarkSeperator, nPos + 1 )) ) nPos = nLastPos; + IDocumentMarkAccess::const_iterator_t ppMark; + IDocumentMarkAccess* const pMarkAccess = pWrtShell->getIDocumentMarkAccess(); if( STRING_NOTFOUND != nPos && ( sCmp = sMark.Copy( nPos + 1 ) ).EraseAllChars().Len() ) { @@ -1919,8 +1929,8 @@ BOOL SwView::JumpToSwMark( const String& rMark ) bRet = TRUE; } } - else if( USHRT_MAX != ( nPos = pWrtShell->FindBookmark( sMark ) )) - pWrtShell->GotoBookmark( nPos, FALSE, TRUE ), bRet = TRUE; + else if( pMarkAccess->getMarksEnd() != (ppMark = pMarkAccess->findMark(sMark)) ) + pWrtShell->GotoMark( ppMark->get(), FALSE, TRUE ), bRet = TRUE; else if( 0 != ( pINet = pWrtShell->FindINetAttr( sMark ) )) bRet = pWrtShell->GotoINetAttr( *pINet->GetTxtINetFmt() ); @@ -1941,8 +1951,8 @@ BOOL SwView::JumpToSwMark( const String& rMark ) } } } - else if( USHRT_MAX != ( nPos = pWrtShell->FindBookmark( sMark ) )) - pWrtShell->GotoBookmark( nPos, FALSE, TRUE ), bRet = TRUE; + else if( pMarkAccess->getMarksEnd() != (ppMark = pMarkAccess->findMark(sMark))) + pWrtShell->GotoMark( ppMark->get(), FALSE, TRUE ), bRet = TRUE; else if( 0 != ( pINet = pWrtShell->FindINetAttr( sMark ) )) bRet = pWrtShell->GotoINetAttr( *pINet->GetTxtINetFmt() ); |