Kaydet (Commit) b7f20ef3 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Unwind HighlightPortions typedef

Change-Id: I0ecc15f9bfd557d0a70a05536906a4984a46463c
üst c9bca105
......@@ -594,7 +594,7 @@ void EditorWindow::HandleAutoCorrect()
OUString aLine( pEditEngine->GetText( nLine ) ); // the line being modified
const OUString& sActSubName = GetActualSubName( nLine ); // the actual procedure
HighlightPortions aPortions;
std::vector<HighlightPortion> aPortions;
aHighlighter.getHighlightPortions( nLine, aLine, aPortions );
if( aPortions.size() == 0 )
......@@ -668,7 +668,7 @@ TextSelection EditorWindow::GetLastHighlightPortionTextSelection()
sal_uLong nLine = GetEditView()->GetSelection().GetStart().GetPara();
sal_uLong nIndex = GetEditView()->GetSelection().GetStart().GetIndex();
OUString aLine( pEditEngine->GetText( nLine ) ); // the line being modified
HighlightPortions aPortions;
std::vector<HighlightPortion> aPortions;
aHighlighter.getHighlightPortions( nLine, aLine, aPortions );
HighlightPortion& r = aPortions[aPortions.size()-1];
......@@ -714,7 +714,7 @@ void EditorWindow::HandleAutoCloseDoubleQuotes()
sal_uLong nLine = aSel.GetStart().GetPara();
OUString aLine( pEditEngine->GetText( nLine ) ); // the line being modified
HighlightPortions aPortions;
std::vector<HighlightPortion> aPortions;
aHighlighter.getHighlightPortions( nLine, aLine, aPortions );
if( aPortions.size() == 0 )
......@@ -735,7 +735,7 @@ void EditorWindow::HandleProcedureCompletion()
sal_uLong nLine = aSel.GetStart().GetPara();
OUString aLine( pEditEngine->GetText( nLine ) );
HighlightPortions aPortions;
std::vector<HighlightPortion> aPortions;
aHighlighter.getHighlightPortions( nLine, aLine, aPortions );
if( aPortions.size() == 0 )
......@@ -785,7 +785,7 @@ void EditorWindow::HandleProcedureCompletion()
for( sal_uLong i = nLine+1; i < pEditEngine->GetParagraphCount(); ++i )
{//searching forward for end token, or another sub/function definition
OUString aCurrLine = pEditEngine->GetText( i );
HighlightPortions aCurrPortions;
std::vector<HighlightPortion> aCurrPortions;
aHighlighter.getHighlightPortions( i, aCurrLine, aCurrPortions );
if( aCurrPortions.size() >= 3 )
......@@ -818,12 +818,12 @@ void EditorWindow::HandleCodeCompletion()
OUString aLine( pEditEngine->GetText( nLine ) ); // the line being modified
std::vector< OUString > aVect; //vector to hold the base variable+methods for the nested reflection
HighlightPortions aPortions;
std::vector<HighlightPortion> aPortions;
aLine = aLine.copy(0, aSel.GetEnd().GetIndex());
aHighlighter.getHighlightPortions( nLine, aLine, aPortions );
if( aPortions.size() > 0 )
{//use the syntax highlighter to grab out nested reflection calls, eg. aVar.aMethod("aa").aOtherMethod ..
for( HighlightPortions::reverse_iterator aIt = aPortions.rbegin(); aIt != aPortions.rend(); ++aIt )
for( std::vector<HighlightPortion>::reverse_iterator aIt = aPortions.rbegin(); aIt != aPortions.rend(); ++aIt )
{
HighlightPortion r = *aIt;
if( r.tokenType == TT_WHITESPACE ) // a whitespace: stop; if there is no ws, it goes to the beginning of the line
......@@ -1186,7 +1186,7 @@ void EditorWindow::ImpDoHighlight( sal_uLong nLine )
bool const bWasModified = pEditEngine->IsModified();
pEditEngine->RemoveAttribs( nLine, true );
HighlightPortions aPortions;
std::vector<HighlightPortion> aPortions;
aHighlighter.getHighlightPortions( nLine, aLine, aPortions );
for ( size_t i = 0; i < aPortions.size(); i++ )
......
......@@ -659,7 +659,7 @@ sal_uInt16 SimpleTokenizer_Impl::parseLine( sal_uInt32 nParseLine, const OUStrin
}
void SimpleTokenizer_Impl::getHighlightPortions( sal_uInt32 nParseLine, const OUString& rLine,
/*out*/HighlightPortions& portions )
/*out*/std::vector<HighlightPortion>& portions )
{
// Set the position to the beginning of the source string
mpStringBegin = mpActualPos = rLine.getStr();
......@@ -731,7 +731,7 @@ void SyntaxHighlighter::notifyChange( sal_uInt32 nLine, sal_Int32 nLineCountDiff
}
void SyntaxHighlighter::getHighlightPortions( sal_uInt32 nLine, const OUString& rLine,
/*out*/HighlightPortions& portions )
/*out*/std::vector<HighlightPortion>& portions )
{
m_pSimpleTokenizer->getHighlightPortions( nLine, rLine, portions );
}
......
......@@ -150,7 +150,7 @@ void BasicCodeTagger::tagParagraph( xmlNodePtr paragraph )
strlen(reinterpret_cast<const char*>(codeSnippet)),
RTL_TEXTENCODING_UTF8 );
m_Highlighter.notifyChange ( 0, 0, &strLine, 1 );
HighlightPortions portions;
std::vector<HighlightPortion> portions;
m_Highlighter.getHighlightPortions( 0, strLine, portions );
for ( size_t i=0; i<portions.size(); i++ )
{
......
......@@ -46,9 +46,6 @@ enum TokenTypes
struct HighlightPortion { sal_uInt16 nBegin; sal_uInt16 nEnd; TokenTypes tokenType; };
typedef std::vector<HighlightPortion> HighlightPortions;
/////////////////////////////////////////////////////////////////////////
// Auxiliary class to support JavaScript modules, next to find functions which
// will later will be used for syntax highlighting
......@@ -108,7 +105,7 @@ public:
sal_uInt16 parseLine( sal_uInt32 nLine, const OUString* aSource );
void getHighlightPortions( sal_uInt32 nParseLine, const OUString& rLine,
/*out*/HighlightPortions& portions );
/*out*/std::vector<HighlightPortion>& portions );
void setKeyWords( const char** ppKeyWords, sal_uInt16 nCount );
};
......@@ -140,7 +137,7 @@ public:
const OUString* pChangedLines, sal_uInt32 nArrayLength);
void getHighlightPortions( sal_uInt32 nLine, const OUString& rLine,
HighlightPortions& pPortions );
std::vector<HighlightPortion>& pPortions );
HighlighterLanguage GetLanguage() { return eLanguage;}
};
......
......@@ -174,7 +174,7 @@ void MultiLineEditSyntaxHighlight::UpdateData()
aHighlighter.notifyChange( nLine, 0, &aLine, 1 );
GetTextEngine()->RemoveAttribs( nLine, sal_True );
HighlightPortions aPortions;
std::vector<HighlightPortion> aPortions;
aHighlighter.getHighlightPortions( nLine, aLine, aPortions );
for ( size_t i = 0; i < aPortions.size(); i++ )
{
......
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