Kaydet (Commit) cdc6075e authored tarafından Jim Raykowski's avatar Jim Raykowski Kaydeden (comit) Thorsten Behrens

tdf#115600 Display messages in Findbar for Index entry navigation

...and make Index entry navigation wrap

Change-Id: Ia579b65f85ee1cbf0c4f88f4ff599a5193aea1e3
Reviewed-on: https://gerrit.libreoffice.org/54891Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 25d6789e
......@@ -493,6 +493,8 @@ bool SwCursorShell::GotoNxtPrvTableFormula( bool bNext, bool bOnlyErrors )
/// jump to next/previous index marker
bool SwCursorShell::GotoNxtPrvTOXMark( bool bNext )
{
SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty );
if( IsTableMode() )
return false;
......@@ -515,30 +517,52 @@ bool SwCursorShell::GotoNxtPrvTOXMark( bool bNext )
const SwTextTOXMark* pTextTOX;
sal_uInt32 n, nMaxItems = GetDoc()->GetAttrPool().GetItemCount2( RES_TXTATR_TOXMARK );
for( n = 0; n < nMaxItems; ++n )
if( nMaxItems > 0 )
{
const SfxPoolItem* pItem;
const SwContentFrame* pCFrame;
if( nullptr != (pItem = GetDoc()->GetAttrPool().GetItem2(
RES_TXTATR_TOXMARK, n ) ) &&
nullptr != (pTextTOX = static_cast<const SwTOXMark*>(pItem)->GetTextTOXMark() ) &&
( pTextNd = &pTextTOX->GetTextNode())->GetNodes().IsDocNodes() &&
nullptr != ( pCFrame = pTextNd->getLayoutFrame( GetLayout(), &aPt, nullptr, false )) &&
( IsReadOnlyAvailable() || !pCFrame->IsProtected() ))
{
SwNodeIndex aNdIndex( *pTextNd ); // UNIX needs this object
SetGetExpField aCmp( aNdIndex, *pTextTOX );
aCmp.SetBodyPos( *pCFrame );
do {
for( n = 0; n < nMaxItems; ++n )
{
const SfxPoolItem* pItem;
const SwContentFrame* pCFrame;
if( nullptr != (pItem = GetDoc()->GetAttrPool().GetItem2(
RES_TXTATR_TOXMARK, n ) ) &&
nullptr != (pTextTOX = static_cast<const SwTOXMark*>(pItem)->GetTextTOXMark() ) &&
( pTextNd = &pTextTOX->GetTextNode())->GetNodes().IsDocNodes() &&
nullptr != ( pCFrame = pTextNd->getLayoutFrame( GetLayout(), &aPt, nullptr, false )) &&
( IsReadOnlyAvailable() || !pCFrame->IsProtected() ))
{
SwNodeIndex aNdIndex( *pTextNd ); // UNIX needs this object
SetGetExpField aCmp( aNdIndex, *pTextTOX );
aCmp.SetBodyPos( *pCFrame );
if( bNext ? ( aCurGEF < aCmp && aCmp < aFndGEF )
: ( aCmp < aCurGEF && aFndGEF < aCmp ))
if( bNext ? ( aCurGEF < aCmp && aCmp < aFndGEF )
: ( aCmp < aCurGEF && aFndGEF < aCmp ))
{
aFndGEF = aCmp;
bFnd = true;
}
}
}
if( !bFnd )
{
aFndGEF = aCmp;
bFnd = true;
if ( bNext )
{
rPos.nNode = 0;
rPos.nContent = 0;
aCurGEF = SetGetExpField( rPos );
SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::EndWrapped );
}
else
{
aCurGEF = SetGetExpField( SwPosition( GetDoc()->GetNodes().GetEndOfContent() ) );
SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::StartWrapped );
}
}
}
} while ( !bFnd );
}
else
SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound );
}
if( bFnd )
......
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