summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2010-11-01 16:40:46 +0100
committerVladimir Glazunov <vg@openoffice.org>2010-11-01 16:40:46 +0100
commitf89817da62023a4228dc5c4652d51d1c036d60a5 (patch)
treeae44621a79f7a74289e33c268f6b23f4704f8d70 /svtools
parentd33b58aa369a9347727c3bb7361b537024ad2ce0 (diff)
parentd363b075683f89babef27425ed029583b0fb85dd (diff)
CWS-TOOLING: integrate CWS svarray
Diffstat (limited to 'svtools')
-rw-r--r--svtools/inc/svtools/parrtf.hxx4
-rw-r--r--svtools/inc/svtools/syntaxhighlight.hxx5
-rw-r--r--svtools/source/edit/editsyntaxhighlighter.cxx2
-rw-r--r--svtools/source/edit/makefile.mk10
-rw-r--r--svtools/source/edit/syntaxhighlight.cxx5
-rw-r--r--svtools/source/edit/textdata.cxx10
-rw-r--r--svtools/source/svrtf/makefile.mk2
-rw-r--r--svtools/source/svrtf/parrtf.cxx33
8 files changed, 31 insertions, 40 deletions
diff --git a/svtools/inc/svtools/parrtf.hxx b/svtools/inc/svtools/parrtf.hxx
index 179f5a28259a..b96e3937231d 100644
--- a/svtools/inc/svtools/parrtf.hxx
+++ b/svtools/inc/svtools/parrtf.hxx
@@ -30,7 +30,7 @@
#include "svtools/svtdllapi.h"
#include <svtools/svparser.hxx>
-#include <svl/svarray.hxx>
+#include <stack>
struct RtfParserState_Impl
{
@@ -42,7 +42,7 @@ struct RtfParserState_Impl
{}
};
-SV_DECL_VARARR( RtfParserStates_Impl, RtfParserState_Impl, 16, 16 )
+typedef std::stack< RtfParserState_Impl > RtfParserStates_Impl;
class SVT_DLLPUBLIC SvRTFParser : public SvParser
{
diff --git a/svtools/inc/svtools/syntaxhighlight.hxx b/svtools/inc/svtools/syntaxhighlight.hxx
index 8cf7126fa24c..e406c33fc54f 100644
--- a/svtools/inc/svtools/syntaxhighlight.hxx
+++ b/svtools/inc/svtools/syntaxhighlight.hxx
@@ -57,8 +57,6 @@
#include <tools/string.hxx>
#include <tools/gen.hxx>
-#include <svl/svarray.hxx>
-
// Token-Typen TT_...
enum TokenTypes
@@ -79,8 +77,7 @@ enum TokenTypes
struct HighlightPortion { UINT16 nBegin; UINT16 nEnd; TokenTypes tokenType; };
-
-SV_DECL_VARARR(HighlightPortions, HighlightPortion, 0, 16)
+typedef std::vector<HighlightPortion> HighlightPortions;
/////////////////////////////////////////////////////////////////////////
// Hilfsklasse zur Untersuchung von JavaScript-Modulen, zunaechst zum
diff --git a/svtools/source/edit/editsyntaxhighlighter.cxx b/svtools/source/edit/editsyntaxhighlighter.cxx
index 01bb7ad41682..af38c444c0f2 100644
--- a/svtools/source/edit/editsyntaxhighlighter.cxx
+++ b/svtools/source/edit/editsyntaxhighlighter.cxx
@@ -193,7 +193,7 @@ void MultiLineEditSyntaxHighlight::UpdateData()
GetTextEngine()->RemoveAttribs( nLine, TRUE );
HighlightPortions aPortions;
aHighlighter.getHighlightPortions( nLine, aLine, aPortions );
- for ( USHORT i = 0; i < aPortions.Count(); i++ )
+ for ( size_t i = 0; i < aPortions.size(); i++ )
{
HighlightPortion& r = aPortions[i];
GetTextEngine()->SetAttrib( TextAttribFontColor( GetColorValue(r.tokenType) ), nLine, r.nBegin, r.nEnd, TRUE );
diff --git a/svtools/source/edit/makefile.mk b/svtools/source/edit/makefile.mk
index 58a63be58f78..8d4da553cb0d 100644
--- a/svtools/source/edit/makefile.mk
+++ b/svtools/source/edit/makefile.mk
@@ -38,25 +38,23 @@ TARGET=edit
# --- Files --------------------------------------------------------
SLOFILES= \
+ $(EXCEPTIONSFILES) \
$(SLO)$/textdata.obj \
- $(SLO)$/textdoc.obj \
- $(SLO)$/texteng.obj \
$(SLO)$/textundo.obj \
- $(SLO)$/textview.obj \
$(SLO)$/txtattr.obj \
$(SLO)$/xtextedt.obj \
$(SLO)$/sychconv.obj \
$(SLO)$/svmedit.obj \
$(SLO)$/svmedit2.obj \
- $(SLO)$/textwindowpeer.obj \
- $(SLO)$/syntaxhighlight.obj \
$(SLO)$/editsyntaxhighlighter.obj
EXCEPTIONSFILES= \
$(SLO)$/textview.obj \
$(SLO)$/textdoc.obj \
$(SLO)$/texteng.obj \
- $(SLO)$/textwindowpeer.obj
+ $(SLO)$/textwindowpeer.obj \
+ $(SLO)$/syntaxhighlight.obj \
+
# --- Targets ------------------------------------------------------
diff --git a/svtools/source/edit/syntaxhighlight.cxx b/svtools/source/edit/syntaxhighlight.cxx
index 5729eb712bfe..87585f5b2587 100644
--- a/svtools/source/edit/syntaxhighlight.cxx
+++ b/svtools/source/edit/syntaxhighlight.cxx
@@ -34,9 +34,6 @@
#include <tools/debug.hxx>
-SV_IMPL_VARARR(HighlightPortions, HighlightPortion)
-
-
// ##########################################################################
// ATTENTION: all these words needs to be in small caps
// ##########################################################################
@@ -849,7 +846,7 @@ void SimpleTokenizer_Impl::getHighlightPortions( UINT32 nParseLine, const String
portion.nEnd = (UINT16)(pEndPos - mpStringBegin);
portion.tokenType = eType;
- portions.Insert(portion, portions.Count());
+ portions.push_back(portion);
}
}
diff --git a/svtools/source/edit/textdata.cxx b/svtools/source/edit/textdata.cxx
index 32bdfe40a3fb..cb33ea7d50e6 100644
--- a/svtools/source/edit/textdata.cxx
+++ b/svtools/source/edit/textdata.cxx
@@ -37,7 +37,7 @@ SV_IMPL_PTRARR( TextLines, TextLinePtr );
SV_IMPL_VARARR( TEWritingDirectionInfos, TEWritingDirectionInfo );
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TextSelection
// -------------------------------------------------------------------------
@@ -66,7 +66,7 @@ void TextSelection::Justify()
}
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TETextPortionList
// -------------------------------------------------------------------------
TETextPortionList::TETextPortionList()
@@ -129,7 +129,7 @@ USHORT TETextPortionList::GetPortionStartIndex( USHORT nPortion )
*/
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TEParaPortion
// -------------------------------------------------------------------------
TEParaPortion::TEParaPortion( TextNode* pN )
@@ -254,7 +254,7 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedL
}
}
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TEParaPortions
// -------------------------------------------------------------------------
TEParaPortions::TEParaPortions()
@@ -274,7 +274,7 @@ void TEParaPortions::Reset()
clear();
}
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class IdleFormatter
// -------------------------------------------------------------------------
IdleFormatter::IdleFormatter()
diff --git a/svtools/source/svrtf/makefile.mk b/svtools/source/svrtf/makefile.mk
index 5ebb0e28c69e..cb76882f5f94 100644
--- a/svtools/source/svrtf/makefile.mk
+++ b/svtools/source/svrtf/makefile.mk
@@ -30,6 +30,8 @@ PRJ=..$/..
PRJNAME=svtools
TARGET=svrtf
+ENABLE_EXCEPTIONS=TRUE
+
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index 1c578d160307..3a775a7fc345 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -44,8 +44,6 @@ const int MAX_TOKEN_LEN = 128;
#define RTF_ISDIGIT( c ) (c >= '0' && c <= '9')
#define RTF_ISALPHA( c ) ( (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') )
-SV_IMPL_VARARR( RtfParserStates_Impl, RtfParserState_Impl )
-
SvRTFParser::SvRTFParser( SvStream& rIn, BYTE nStackSize )
: SvParser( rIn, nStackSize ),
eUNICodeSet( RTL_TEXTENCODING_MS_1252 ), // default ist ANSI-CodeSet
@@ -175,14 +173,13 @@ int SvRTFParser::_GetNextToken()
nUCharOverread = (BYTE)nTokenValue;
#if 1
//cmc: other ifdef breaks #i3584
- aParserStates[ aParserStates.Count()-1].
+ aParserStates.top().
nUCharOverread = nUCharOverread;
#else
if( !nUCharOverread )
- nUCharOverread = aParserStates[
- aParserStates.Count()-1].nUCharOverread;
+ nUCharOverread = aParserStates.top().nUCharOverread;
else
- aParserStates[ aParserStates.Count()-1].
+ aParserStates.top().
nUCharOverread = nUCharOverread;
#endif
}
@@ -252,12 +249,12 @@ int SvRTFParser::_GetNextToken()
if( 0 <= nOpenBrakets )
{
RtfParserState_Impl aState( nUCharOverread, GetSrcEncoding() );
- aParserStates.Insert(
- aState, sal::static_int_cast< USHORT >(nOpenBrakets) );
+ aParserStates.push( aState );
}
++nOpenBrakets;
- DBG_ASSERT( nOpenBrakets == aParserStates.Count(),
- "ParserStateStack unequal to bracket count" );
+ DBG_ASSERT(
+ static_cast<size_t>(nOpenBrakets) == aParserStates.size(),
+ "ParserStateStack unequal to bracket count" );
nRet = nNextCh;
}
break;
@@ -266,12 +263,11 @@ int SvRTFParser::_GetNextToken()
--nOpenBrakets;
if( 0 <= nOpenBrakets )
{
- aParserStates.Remove(
- sal::static_int_cast< USHORT >(nOpenBrakets) );
- if( aParserStates.Count() )
+ aParserStates.pop();
+ if( !aParserStates.empty() )
{
const RtfParserState_Impl& rRPS =
- aParserStates[ aParserStates.Count() - 1 ];
+ aParserStates.top();
nUCharOverread = rRPS.nUCharOverread;
SetSrcEncoding( rRPS.eCodeSet );
}
@@ -281,8 +277,9 @@ int SvRTFParser::_GetNextToken()
SetSrcEncoding( GetCodeSet() );
}
}
- DBG_ASSERT( nOpenBrakets == aParserStates.Count(),
- "ParserStateStack unequal to bracket count" );
+ DBG_ASSERT(
+ static_cast<size_t>(nOpenBrakets) == aParserStates.size(),
+ "ParserStateStack unequal to bracket count" );
nRet = nNextCh;
break;
@@ -690,8 +687,8 @@ void SvRTFParser::SetEncoding( rtl_TextEncoding eEnc )
if (eEnc == RTL_TEXTENCODING_DONTKNOW)
eEnc = GetCodeSet();
- if (aParserStates.Count())
- aParserStates[aParserStates.Count() - 1].eCodeSet = eEnc;
+ if (!aParserStates.empty())
+ aParserStates.top().eCodeSet = eEnc;
SetSrcEncoding(eEnc);
}