summaryrefslogtreecommitdiffstats
path: root/basctl/source/basicide/baside2.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'basctl/source/basicide/baside2.cxx')
-rw-r--r--basctl/source/basicide/baside2.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index ee451cf59d8c..339f2d65733a 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -1113,19 +1113,18 @@ void ModulWindow::GetState( SfxItemSet &rSet )
TextView* pView = GetEditView();
if ( pView )
{
-
OUString sProcName;
- bool bFound = false;
TextSelection aSel = pView->GetSelection();
- long nLine = aSel.GetStart().GetPara();
- for (long i = nLine; i >= 0 && !bFound; --i)
+ sal_uInt32 i = aSel.GetStart().GetPara();
+ do
{
OUString aCurrLine = GetEditEngine()->GetText( i );
OUString sProcType;
- bFound = GetEditorWindow().GetProcedureName(aCurrLine, sProcType, sProcName);
- }
+ if (GetEditorWindow().GetProcedureName(aCurrLine, sProcType, sProcName))
+ break;
+ } while (i--);
OUString aTitle = CreateQualifiedName();
if (!sProcName.isEmpty())