summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basctl/source/basicide/baside2.cxx11
-rw-r--r--svtools/source/edit/editsyntaxhighlighter.cxx7
2 files changed, 9 insertions, 9 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())
diff --git a/svtools/source/edit/editsyntaxhighlighter.cxx b/svtools/source/edit/editsyntaxhighlighter.cxx
index 224017a5e153..cf734c0cf6ff 100644
--- a/svtools/source/edit/editsyntaxhighlighter.cxx
+++ b/svtools/source/edit/editsyntaxhighlighter.cxx
@@ -43,7 +43,7 @@ void MultiLineEditSyntaxHighlight::DoBracketHilight(sal_uInt16 nKey)
{
TextSelection aCurrentPos = GetTextView()->GetSelection();
sal_Int32 nStartPos = aCurrentPos.GetStart().GetIndex();
- sal_Int32 nStartPara = aCurrentPos.GetStart().GetPara();
+ const sal_uInt32 nStartPara = aCurrentPos.GetStart().GetPara();
sal_uInt16 nCount = 0;
int nChar = -1;
@@ -74,7 +74,8 @@ void MultiLineEditSyntaxHighlight::DoBracketHilight(sal_uInt16 nKey)
if (nChar != -1)
{
- for (sal_Int32 nPara = nStartPara; nPara >= 0; --nPara)
+ sal_uInt32 nPara = nStartPara;
+ do
{
if (nPara == nStartPara && nStartPos == 0)
continue;
@@ -102,7 +103,7 @@ void MultiLineEditSyntaxHighlight::DoBracketHilight(sal_uInt16 nKey)
if (aLine[i] == nKey)
++nCount;
}
- }
+ } while (nPara--);
}
}