[Libreoffice-commits] .: 9 commits - l10ntools/inc l10ntools/source rsc/inc rsc/source svtools/source sw/inc sw/source
Caolán McNamara
caolan at kemper.freedesktop.org
Mon Dec 12 01:39:28 PST 2011
l10ntools/inc/cfgmerge.hxx | 69 +++++++---------
l10ntools/inc/srciter.hxx | 2
l10ntools/source/cfgmerge.cxx | 99 +++++++++--------------
l10ntools/source/localize.cxx | 24 +----
l10ntools/source/srciter.cxx | 11 --
rsc/inc/rscconst.hxx | 2
rsc/inc/rscdb.hxx | 26 +++---
rsc/inc/rscdef.hxx | 20 ++--
rsc/inc/rscrsc.hxx | 40 ++++-----
rsc/inc/rsctools.hxx | 8 -
rsc/inc/rsctop.hxx | 12 +-
rsc/inc/rsctree.hxx | 8 -
rsc/source/parser/erscerr.cxx | 2
rsc/source/parser/rscdb.cxx | 10 +-
rsc/source/parser/rscibas.cxx | 12 +-
rsc/source/parser/rsclex.cxx | 2
rsc/source/parser/rscyacc.y | 10 +-
rsc/source/prj/start.cxx | 46 +++++-----
rsc/source/res/rscclass.cxx | 6 -
rsc/source/res/rsccont.cxx | 2
rsc/source/res/rscmgr.cxx | 24 ++---
rsc/source/res/rscrange.cxx | 2
rsc/source/res/rscstr.cxx | 2
rsc/source/res/rsctop.cxx | 4
rsc/source/rsc/rsc.cxx | 163 ++++++++++++++++++--------------------
rsc/source/tools/rscdef.cxx | 22 ++---
rsc/source/tools/rsctools.cxx | 18 ++--
rsc/source/tools/rsctree.cxx | 6 -
svtools/source/brwbox/brwbox2.cxx | 40 ++++++---
sw/inc/ndole.hxx | 3
sw/inc/ndtxt.hxx | 10 --
sw/inc/ndtyp.hxx | 18 ++--
sw/inc/node.hxx | 23 +----
sw/source/core/doc/doc.cxx | 2
sw/source/core/doc/docredln.cxx | 6 -
sw/source/core/docnode/node.cxx | 14 ---
sw/source/filter/html/svxcss1.cxx | 12 --
sw/source/filter/html/svxcss1.hxx | 2
38 files changed, 360 insertions(+), 422 deletions(-)
New commits:
commit 1b1f0bbb28c6146f3aa12ef3f87f2eb1aa0c7479
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Dec 12 09:36:55 2011 +0000
ByteString->rtl::OString
diff --git a/l10ntools/inc/cfgmerge.hxx b/l10ntools/inc/cfgmerge.hxx
index 23bd450..8a09881 100644
--- a/l10ntools/inc/cfgmerge.hxx
+++ b/l10ntools/inc/cfgmerge.hxx
@@ -46,21 +46,22 @@ friend class CfgParser;
friend class CfgExport;
friend class CfgMerge;
private:
- ByteString sTagType;
- ByteString sIdentifier;
+ rtl::OString sTagType;
+ rtl::OString sIdentifier;
- ByteString sResTyp;
+ rtl::OString sResTyp;
- ByteString sTextTag;
- ByteString sEndTextTag;
+ rtl::OString sTextTag;
+ rtl::OString sEndTextTag;
ByteStringHashMap sText;
public:
- CfgStackData( const ByteString &rTag, const ByteString &rId )
- : sTagType( rTag ), sIdentifier( rId ) {};
+ CfgStackData(const rtl::OString &rTag, const rtl::OString &rId)
+ : sTagType( rTag ), sIdentifier( rId )
+ {}
- ByteString &GetTagType() { return sTagType; }
- ByteString &GetIdentifier() { return sIdentifier; }
+ const rtl::OString &GetTagType() { return sTagType; }
+ const rtl::OString &GetIdentifier() { return sIdentifier; }
};
@@ -79,18 +80,19 @@ public:
CfgStack() {}
~CfgStack();
- CfgStackData *Push( const ByteString &rTag, const ByteString &rId );
+ CfgStackData *Push(const rtl::OString &rTag, const rtl::OString &rId);
CfgStackData *Pop()
- {
- if ( maList.empty() ) return NULL;
- CfgStackData* temp = maList.back();
- maList.pop_back();
- return temp;
- }
+ {
+ if (maList.empty())
+ return NULL;
+ CfgStackData* temp = maList.back();
+ maList.pop_back();
+ return temp;
+ }
CfgStackData *GetStackData( size_t nPos = LIST_APPEND );
- ByteString GetAccessPath( size_t nPos = LIST_APPEND );
+ rtl::OString GetAccessPath( size_t nPos = LIST_APPEND );
size_t size() const { return maList.size(); }
};
@@ -102,11 +104,11 @@ public:
class CfgParser
{
protected:
- ByteString sCurrentResTyp;
- ByteString sCurrentIsoLang;
+ rtl::OString sCurrentResTyp;
+ rtl::OString sCurrentIsoLang;
ByteString sCurrentText;
- ByteString sLastWhitespace;
+ rtl::OString sLastWhitespace;
CfgStack aStack;
CfgStackData *pStackData;
@@ -115,11 +117,11 @@ protected:
virtual void WorkOnText(
ByteString &rText,
- const ByteString &nLangIndex )=0;
+ const rtl::OString &rLangIndex )=0;
virtual void WorkOnRessourceEnd()=0;
- virtual void Output( const ByteString& rOutput )=0;
+ virtual void Output(const rtl::OString & rOutput)=0;
void Error( const ByteString &rError );
@@ -131,7 +133,7 @@ private:
const ByteString &rIsoLang,
const ByteString &rResTyp );
-sal_Bool IsTokenClosed( const ByteString &rToken );
+ sal_Bool IsTokenClosed(const rtl::OString &rToken);
public:
CfgParser();
@@ -164,13 +166,13 @@ private:
ByteString sPath;
std::vector<ByteString> aLanguages;
protected:
- void WorkOnText(
+ virtual void WorkOnText(
ByteString &rText,
- const ByteString &rIsoLang
+ const rtl::OString &rIsoLang
);
void WorkOnRessourceEnd();
- void Output( const ByteString& rOutput );
+ void Output(const rtl::OString& rOutput);
public:
CfgExport(
const ByteString &rOutputFile,
@@ -191,23 +193,18 @@ private:
std::vector<ByteString> aLanguages;
ResData *pResData;
- ByteString sFilename;
+ rtl::OString sFilename;
sal_Bool bEnglish;
protected:
- void WorkOnText(
- ByteString &rText,
- const ByteString &nLangIndex );
+ virtual void WorkOnText(ByteString &rText, const rtl::OString &rLangIndex);
void WorkOnRessourceEnd();
- void Output( const ByteString& rOutput );
+ void Output(const rtl::OString& rOutput);
public:
- CfgMerge(
- const ByteString &rMergeSource,
- const ByteString &rOutputFile,
- ByteString &rFilename
- );
+ CfgMerge(const rtl::OString &rMergeSource,
+ const rtl::OString &rOutputFile, const rtl::OString &rFilename);
~CfgMerge();
};
diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx
index a6fdb98..30c8942 100644
--- a/l10ntools/source/cfgmerge.cxx
+++ b/l10ntools/source/cfgmerge.cxx
@@ -64,8 +64,8 @@ ByteString sPrjRoot;
ByteString sInputFileName;
ByteString sActFileName;
ByteString sFullEntry;
-ByteString sOutputFile;
-ByteString sMergeSrc;
+rtl::OString sOutputFile;
+rtl::OString sMergeSrc;
String sUsedTempFile;
CfgParser *pParser;
@@ -145,7 +145,7 @@ extern char *GetOutputFile( int argc, char* argv[])
}
break;
case STATE_MERGESRC: {
- sMergeSrc = ByteString( argv[ i ]);
+ sMergeSrc = rtl::OString(argv[i]);
bMergeMode = sal_True; // activate merge mode, cause merge database found
}
break;
@@ -160,26 +160,25 @@ extern char *GetOutputFile( int argc, char* argv[])
if ( bInput ) {
// command line is valid
bEnableExport = sal_True;
- char *pReturn = new char[ sOutputFile.Len() + 1 ];
- strcpy( pReturn, sOutputFile.GetBuffer()); // #100211# - checked
+ char *pReturn = new char[ sOutputFile.getLength() + 1 ];
+ strcpy( pReturn, sOutputFile.getStr()); // #100211# - checked
return pReturn;
}
// command line is not valid
return NULL;
}
-/*****************************************************************************/
+
int InitCfgExport( char *pOutput , char* pFilename )
-/*****************************************************************************/
{
// instanciate Export
- ByteString sOutput( pOutput );
+ rtl::OString sOutput( pOutput );
ByteString sFilename( pFilename );
Export::InitLanguages();
if ( bMergeMode )
pParser = new CfgMerge( sMergeSrc, sOutputFile, sFilename );
- else if ( sOutputFile.Len())
+ else if ( sOutputFile.getLength())
pParser = new CfgExport( sOutputFile, sPrj, sActFileName );
return 1;
@@ -283,7 +282,7 @@ int GetError()
// class CfgStackData
//
-CfgStackData* CfgStack::Push( const ByteString &rTag, const ByteString &rId )
+CfgStackData* CfgStack::Push(const rtl::OString &rTag, const rtl::OString &rId)
{
CfgStackData *pD = new CfgStackData( rTag, rId );
maList.push_back( pD );
@@ -303,21 +302,20 @@ CfgStack::~CfgStack()
maList.clear();
}
-/*****************************************************************************/
-ByteString CfgStack::GetAccessPath( size_t nPos )
-/*****************************************************************************/
+rtl::OString CfgStack::GetAccessPath( size_t nPos )
{
if ( nPos == LIST_APPEND )
nPos = maList.size() - 1;
- ByteString sReturn;
- for ( size_t i = 0; i <= nPos; i++ ) {
- if ( i )
- sReturn += ".";
- sReturn += GetStackData( i )->GetIdentifier();
+ rtl::OStringBuffer sReturn;
+ for (size_t i = 0; i <= nPos; ++i)
+ {
+ if (i)
+ sReturn.append('.');
+ sReturn.append(GetStackData( i )->GetIdentifier());
}
- return sReturn;
+ return sReturn.makeStringAndClear();
}
/*****************************************************************************/
@@ -347,18 +345,13 @@ CfgParser::CfgParser()
{
}
-/*****************************************************************************/
CfgParser::~CfgParser()
-/*****************************************************************************/
{
}
-
-/*****************************************************************************/
-sal_Bool CfgParser::IsTokenClosed( const ByteString &rToken )
-/*****************************************************************************/
+sal_Bool CfgParser::IsTokenClosed(const rtl::OString &rToken)
{
- return rToken.GetChar( rToken.Len() - 2 ) == '/';
+ return rToken[rToken.getLength() - 2] == '/';
}
/*****************************************************************************/
@@ -392,7 +385,7 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken )
if ( sToken == " " || sToken == "\t" )
sLastWhitespace += sToken;
- ByteString sTokenName;
+ rtl::OString sTokenName;
ByteString sTokenId;
sal_Bool bOutput = sal_True;
@@ -484,13 +477,15 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken )
break;
case CFG_CLOSETAG:
sTokenName = getToken(getToken(getToken(sToken, 1, '/'), 0, '>'), 0, ' ');
- if ( aStack.GetStackData() && ( aStack.GetStackData()->GetTagType() == sTokenName )) {
- if ( ! sCurrentText.Len())
+ if ( aStack.GetStackData() && ( aStack.GetStackData()->GetTagType() == sTokenName ))
+ {
+ if (!sCurrentText.Len())
WorkOnRessourceEnd();
aStack.Pop();
pStackData = aStack.GetStackData();
}
- else {
+ else
+ {
ByteString sError( "Misplaced close tag: " );
ByteString sInFile(" in file ");
sError += sToken;
@@ -511,7 +506,8 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken )
break;
}
- if ( sCurrentText.Len() && nToken != CFG_TEXTCHAR ) {
+ if ( sCurrentText.Len() && nToken != CFG_TEXTCHAR )
+ {
AddText( sCurrentText, sCurrentIsoLang, sCurrentResTyp );
Output( sCurrentText );
sCurrentText = "";
@@ -527,12 +523,8 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken )
return 1;
}
-/*****************************************************************************/
-void CfgExport::Output( const ByteString& rOutput )
-/*****************************************************************************/
+void CfgExport::Output(const rtl::OString&)
{
- // Dummy operation to suppress warnings caused by poor class design
- ByteString a( rOutput );
}
/*****************************************************************************/
@@ -681,14 +673,12 @@ void CfgExport::WorkOnRessourceEnd()
}
}
-/*****************************************************************************/
void CfgExport::WorkOnText(
ByteString &rText,
- const ByteString &rIsoLang
+ const rtl::OString &rIsoLang
)
-/*****************************************************************************/
{
- if( rIsoLang.Len() ) Export::UnquotHTML( rText );
+ if( rIsoLang.getLength() ) Export::UnquotHTML( rText );
}
@@ -696,18 +686,16 @@ void CfgExport::WorkOnText(
// class CfgMerge
//
-/*****************************************************************************/
CfgMerge::CfgMerge(
- const ByteString &rMergeSource, const ByteString &rOutputFile,
- ByteString &rFilename )
-/*****************************************************************************/
+ const rtl::OString &rMergeSource, const rtl::OString &rOutputFile,
+ const rtl::OString &rFilename)
: CfgOutputParser( rOutputFile ),
pMergeDataFile( NULL ),
pResData( NULL ),
sFilename( rFilename ),
bEnglish( sal_False )
{
- if (rMergeSource.Len())
+ if (rMergeSource.getLength())
{
pMergeDataFile = new MergeDataFile(
rMergeSource, sInputFileName, bErrorLog, true );
@@ -730,12 +718,7 @@ CfgMerge::~CfgMerge()
delete pResData;
}
-/*****************************************************************************/
-void CfgMerge::WorkOnText(
- ByteString &rText,
- const ByteString& nLangIndex
-)
-/*****************************************************************************/
+void CfgMerge::WorkOnText(ByteString &rText, const rtl::OString& rLangIndex)
{
if ( pMergeDataFile && bLocalize ) {
@@ -757,15 +740,15 @@ void CfgMerge::WorkOnText(
pResData->sResTyp = pStackData->sResTyp;
}
- if (( nLangIndex.EqualsIgnoreCaseAscii("en-US") ))
+ if (rLangIndex.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("en-US")))
bEnglish = sal_True;
PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrysCaseSensitive( pResData );
if ( pEntrys ) {
ByteString sContent;
- pEntrys->GetText( sContent, STRING_TYP_TEXT, nLangIndex );
+ pEntrys->GetText( sContent, STRING_TYP_TEXT, rLangIndex );
- if ( Export::isAllowed( nLangIndex ) &&
+ if ( Export::isAllowed( rLangIndex ) &&
( sContent != "-" ) && ( sContent.Len()))
{
Export::QuotHTML( rText );
@@ -774,12 +757,10 @@ void CfgMerge::WorkOnText(
}
}
-/*****************************************************************************/
-void CfgMerge::Output( const ByteString& rOutput )
-/*****************************************************************************/
+void CfgMerge::Output(const rtl::OString& rOutput)
{
- if ( pOutputStream )
- pOutputStream->Write( rOutput.GetBuffer(), rOutput.Len());
+ if (pOutputStream)
+ pOutputStream->Write(rOutput.getStr(), rOutput.getLength());
}
/*****************************************************************************/
diff --git a/rsc/inc/rscrsc.hxx b/rsc/inc/rscrsc.hxx
index 7a14792..09a91ff 100644
--- a/rsc/inc/rscrsc.hxx
+++ b/rsc/inc/rscrsc.hxx
@@ -97,14 +97,14 @@ private:
void Append( const rtl::OString& rOutputSrs, const rtl::OString& rTmpFile );
bool GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile,
- const WriteRcContext& rContext,
- const ByteString& rBaseFileName,
- ByteString& rImagePath,
- FILE* pSysListFile );
+ const WriteRcContext& rContext,
+ const rtl::OString& rBaseFileName,
+ ByteString& rImagePath,
+ FILE* pSysListFile );
void PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
- const WriteRcContext& rContext,
- const DirEntry& rSrsInPath,
- const DirEntry& rSrsOutPath );
+ const WriteRcContext& rContext,
+ const DirEntry& rSrsInPath,
+ const DirEntry& rSrsOutPath );
public:
RscTypCont* pTC; // String und Id-Verwalter
diff --git a/rsc/source/parser/rscibas.cxx b/rsc/source/parser/rscibas.cxx
index 4e2ba9f..e4cc72a 100644
--- a/rsc/source/parser/rscibas.cxx
+++ b/rsc/source/parser/rscibas.cxx
@@ -147,19 +147,19 @@ void RscLangEnum::Init( RscNameTable& rNames )
rtl::OString aEnvIsoTokens = getenv( "RSC_LANG_ISO" );
if ( aEnvIsoTokens.getLength() )
{
- ByteString aIsoToken;
+ rtl::OString aIsoToken;
sal_uInt16 nTokenCounter = 0;
sal_Bool bOneMore = 1;
while ( bOneMore )
{
aIsoToken = comphelper::string::getToken(aEnvIsoTokens, nTokenCounter, ' ');
- if ( aIsoToken.Len() )
+ if ( aIsoToken.getLength() )
{
- SetConstant( rNames.Put( aIsoToken.GetBuffer(), CONSTNAME, mnLangId ), mnLangId );
+ SetConstant( rNames.Put( aIsoToken.getStr(), CONSTNAME, mnLangId ), mnLangId );
if ( ! GetLangId( aIsoToken ))
ULong_Iso_map[ aIsoToken ] = mnLangId;
#if OSL_DEBUG_LEVEL > 2
- fprintf( stderr, "Env ISO Language out: %s 0x%lx\n", aIsoToken.GetBuffer(), mnLangId );
+ fprintf( stderr, "Env ISO Language out: %s 0x%lx\n", aIsoToken.getStr(), mnLangId );
#endif
mnLangId++;
}
diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx
index df388d9..0edbb54 100644
--- a/rsc/source/parser/rsclex.cxx
+++ b/rsc/source/parser/rsclex.cxx
@@ -381,7 +381,7 @@ void IncludeParser( RscFileInst * pFileInst )
}
else if( INCLUDE_STRING == nToken ){
lKey = pTypCon->aFileTab.NewIncFile( aYYSType.string,
- ByteString() );
+ rtl::OString() );
pFName->InsertDependFile( lKey, ULONG_MAX );
};
};
diff --git a/rsc/source/parser/rscyacc.y b/rsc/source/parser/rscyacc.y
index 6c401d5..4ba11f4 100644
--- a/rsc/source/parser/rscyacc.y
+++ b/rsc/source/parser/rscyacc.y
@@ -504,13 +504,13 @@ type
{
if( $1 )
{
- ByteString aTypeName = pHS->getString( $1->GetId() );
- aTypeName += "[]";
- $$ = pTC->SearchType( pHS->getID( aTypeName.GetBuffer(), true ) );
+ rtl::OString aTypeName = rtl::OStringBuffer(pHS->getString($1->GetId())).
+ append("[]").makeStringAndClear();
+ $$ = pTC->SearchType( pHS->getID( aTypeName.getStr(), true ) );
if( !$$ )
{
RscCont * pCont;
- pCont = new RscCont( pHS->getID( aTypeName.GetBuffer() ), RSC_NOTYPE );
+ pCont = new RscCont( pHS->getID( aTypeName.getStr() ), RSC_NOTYPE );
pCont->SetTypeClass( $1 );
pTC->InsertType( pCont );
$$ = pCont;
diff --git a/rsc/source/prj/start.cxx b/rsc/source/prj/start.cxx
index aeddeb7..08672ba 100644
--- a/rsc/source/prj/start.cxx
+++ b/rsc/source/prj/start.cxx
@@ -62,22 +62,21 @@ int rsc2_main(int, char**);
|*
|* Beschreibung
*************************************************************************/
-static sal_Bool CallPrePro( const ByteString& rInput,
- const ByteString& rOutput,
- RscPtrPtr * pCmdLine,
- sal_Bool bResponse )
+static sal_Bool CallPrePro( const rtl::OString& rInput,
+ const rtl::OString& rOutput, RscPtrPtr * pCmdLine,
+ sal_Bool bResponse )
{
RscPtrPtr aNewCmdL; // Kommandozeile
RscPtrPtr aRespCmdL; // Kommandozeile
RscPtrPtr * pCmdL = &aNewCmdL;
int i, nRet;
FILE* fRspFile = NULL;
- ByteString aRspFileName;
+ rtl::OString aRspFileName;
if( bResponse )
{
aRspFileName = ::GetTmpFileName();
- fRspFile = fopen( aRspFileName.GetBuffer(), "w" );
+ fRspFile = fopen( aRspFileName.getStr(), "w" );
}
if( !fRspFile )
@@ -100,8 +99,8 @@ static sal_Bool CallPrePro( const ByteString& rInput,
}
}
- aNewCmdL.Append( rsc_strdup( rInput.GetBuffer() ) );
- aNewCmdL.Append( rsc_strdup( rOutput.GetBuffer() ) );
+ aNewCmdL.Append( rsc_strdup( rInput.getStr() ) );
+ aNewCmdL.Append( rsc_strdup( rOutput.getStr() ) );
aNewCmdL.Append( (void *)0 );
if ( bVerbose )
@@ -145,11 +144,13 @@ static sal_Bool CallPrePro( const ByteString& rInput,
nRet = rscpp_main( pCmdL->GetCount()-1, (char**)pCmdL->GetBlock() );
if ( fRspFile )
+ {
#if OSL_DEBUG_LEVEL > 5
- fprintf( stderr, "leaving response file %s\n", aRspFileName.GetBuffer() );
+ fprintf( stderr, "leaving response file %s\n", aRspFileName.getStr() );
#else
- unlink( aRspFileName.GetBuffer() );
+ unlink( aRspFileName.getStr() );
#endif
+ }
if ( nRet )
return sal_False;
@@ -163,8 +164,7 @@ static sal_Bool CallPrePro( const ByteString& rInput,
|* Beschreibung
*************************************************************************/
static sal_Bool CallRsc2( RscStrList * pInputList,
- ByteString aSrsName,
- RscPtrPtr * pCmdLine )
+ const rtl::OString &rSrsName, RscPtrPtr * pCmdLine )
{
int nRet;
rtl::OString* pString;
@@ -200,7 +200,7 @@ static sal_Bool CallRsc2( RscStrList * pInputList,
aNewCmdL.Append( rsc_strdup( (char *)pCmdLine->GetEntry( i ) ) );
};
- aNewCmdL.Append( rsc_strdup( aSrsName.GetBuffer() ) );
+ aNewCmdL.Append( rsc_strdup( rSrsName.getStr() ) );
for ( size_t i = 0, n = pInputList->size(); i < n; ++i )
{
@@ -232,12 +232,12 @@ static sal_Bool CallRsc2( RscStrList * pInputList,
*************************************************************************/
SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
{
- sal_Bool bPrePro = sal_True;
- sal_Bool bHelp = sal_False;
- sal_Bool bError = sal_False;
- sal_Bool bResponse = sal_False;
- ByteString aSrsName;
- ByteString aResName;
+ sal_Bool bPrePro = sal_True;
+ sal_Bool bHelp = sal_False;
+ sal_Bool bError = sal_False;
+ sal_Bool bResponse = sal_False;
+ rtl::OString aSrsName;
+ rtl::OString aResName;
RscStrList aInputList;
RscStrList aTmpList;
char * pStr;
@@ -296,12 +296,12 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
if( !aInputList.empty() )
{
/* build the output file names */
- if( ! aResName.Len() )
+ if (!aResName.getLength())
aResName = OutputFile( *aInputList[ 0 ], "res" );
if( ! bSetSrs )
{
- aSrsName = "-fp=";
- aSrsName += OutputFile( *aInputList[ 0 ], "srs" );
+ aSrsName = rtl::OStringBuffer("-fp=").append(OutputFile(*aInputList[0], "srs")).
+ makeStringAndClear();
}
};
@@ -309,7 +309,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
bPrePro = sal_False;
if( bPrePro && !aInputList.empty() )
{
- ByteString aTmpName;
+ rtl::OString aTmpName;
for ( size_t k = 0, n = aInputList.size(); k < n; ++k )
{
diff --git a/rsc/source/res/rscmgr.cxx b/rsc/source/res/rscmgr.cxx
index 078be90..77dbee0 100644
--- a/rsc/source/res/rscmgr.cxx
+++ b/rsc/source/res/rscmgr.cxx
@@ -311,12 +311,12 @@ ERRTYPE RscMgr::WriteRc( const RSCINST &, RscWriteRc &,
}
-static rtl::OString MakeSmartName( const ByteString & rDefName )
+static rtl::OString MakeSmartName( const rtl::OString& rDefName )
{
rtl::OStringBuffer aSmartName;
- if( rDefName.Len() )
+ if( rDefName.getStr() )
{
- char * pStr = (char *)rDefName.GetBuffer();
+ char * pStr = (char *)rDefName.getStr();
aSmartName.append(static_cast<sal_Char>(toupper(*pStr)));
while( *++pStr )
{
@@ -335,10 +335,10 @@ static rtl::OString MakeSmartName( const ByteString & rDefName )
}
static rtl::OString MakeName( RscTypCont * pTypCon, RscTop * pClass,
- const ByteString & rName )
+ const rtl::OString& rName )
{
rtl::OStringBuffer aRet;
- if( !pTypCon->IsSmart() || isdigit( rName.GetChar(0) ) )
+ if( !pTypCon->IsSmart() || isdigit( rName[0] ) )
{
aRet.append(pHS->getString( pClass->GetId() ).getStr());
aRet.append(rName);
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index a638a2c..8aef412 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -856,11 +856,11 @@ ERRTYPE RscCompiler::Link()
pTC->SetSourceCharSet( RTL_TEXTENCODING_UTF8 );
pTC->ClearSysNames();
rtl::OStringBuffer aSysSearchPath(it->aLangSearchPath);
- xub_StrLen nIndex = 0;
- ByteString aSearchPath = pTC->GetSearchPath();
- while( nIndex != STRING_NOTFOUND )
+ sal_Int32 nIndex = 0;
+ rtl::OString aSearchPath = pTC->GetSearchPath();
+ do
{
- ByteString aToken = aSearchPath.GetToken( 0, cSearchDelim, nIndex );
+ rtl::OString aToken = aSearchPath.getToken( 0, cSearchDelim, nIndex );
if (aSysSearchPath.getLength())
aSysSearchPath.append(cSearchDelim);
aSysSearchPath.append(aToken);
@@ -869,6 +869,7 @@ ERRTYPE RscCompiler::Link()
aSysSearchPath.append(cSearchDelim);
aSysSearchPath.append(aToken);
}
+ while ( nIndex >= 0 );
OSL_TRACE( "setting search path for language %s: %s", it->aLangName.GetBuffer(), aSysSearchPath.getStr() );
pTC->SetSysSearchPath(aSysSearchPath.makeStringAndClear());
@@ -975,12 +976,12 @@ ERRTYPE RscCompiler::Link()
pTC->pEH->StdOut( "Generating .cxx file\n" );
- ByteString aHxx = pCL->aOutputHxx;
- if( !aHxx.Len() )
+ rtl::OString aHxx = pCL->aOutputHxx;
+ if( !aHxx.getLength() )
{
UniString aUniOutputCxx( pCL->aOutputCxx, RTL_TEXTENCODING_ASCII_US );
- aHxx = rtl::OUStringToOString(DirEntry( aUniOutputCxx ).GetBase(), RTL_TEXTENCODING_ASCII_US);
- aHxx += ".hxx";
+ aHxx = rtl::OStringBuffer(rtl::OUStringToOString(DirEntry(aUniOutputCxx).GetBase(),
+ RTL_TEXTENCODING_ASCII_US)).append(".hxx").makeStringAndClear();
}
// Schreibe Datei
@@ -1050,20 +1051,17 @@ void RscCompiler::Append( const rtl::OString& rOutputSrs,
bool RscCompiler::GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile,
const WriteRcContext& rContext,
- const ByteString& rBaseFileName,
+ const rtl::OString& rBaseFileName,
ByteString& rImagePath,
FILE* pSysListFile )
{
- ::std::list< ByteString > aFileNames;
- bool bFound = false;
+ ::std::list< rtl::OString > aFileNames;
+ bool bFound = false;
- ByteString aFileName( rBaseFileName );
- aFileNames.push_back( aFileName += ".png" );
+ aFileNames.push_back( rBaseFileName + rtl::OString(".png") );
+ aFileNames.push_back( rBaseFileName + rtl::OString(".bmp") );
- aFileName = rBaseFileName;
- aFileNames.push_back( aFileName += ".bmp" );
-
- ::std::list< ByteString >::iterator aFileIter( aFileNames.begin() );
+ ::std::list< rtl::OString >::iterator aFileIter( aFileNames.begin() );
while( ( aFileIter != aFileNames.end() ) && !bFound )
{
@@ -1090,11 +1088,9 @@ bool RscCompiler::GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile,
while( ( aReplIter != rContext.pCmdLine->m_aReplacements.end() ) && !bFound )
{
- ByteString aSearch( aReplIter->second );
- aSearch.ToLowerAscii();
- ByteString aSearchIn( aRelPathStr );
- aSearchIn.ToLowerAscii();
- if( aSearchIn.Search( aSearch ) == 0 )
+ rtl::OString aSearch(aReplIter->second.toAsciiLowerCase());
+ rtl::OString aSearchIn(aRelPathStr.toAsciiLowerCase());
+ if( aSearchIn.indexOf(aSearch) == 0 )
{
sal_Int32 nCopyPos = aReplIter->second.getLength(), nLength = aRelPathStr.getLength();
const sal_Char* pChars = aRelPathStr.getStr();
@@ -1145,7 +1141,7 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
{
SvFileStream aIStm( rSrsInPath.GetFull(), STREAM_READ );
SvFileStream aOStm( rSrsOutPath.GetFull(), STREAM_WRITE | STREAM_TRUNC );
- ::std::vector< ByteString > aMissingImages;
+ ::std::vector< rtl::OString > aMissingImages;
FILE* pSysListFile = rContext.aOutputSysList.getLength() ? fopen( rContext.aOutputSysList.getStr(), "ab" ) : NULL;
if( !aIStm.GetError() && !aOStm.GetError() )
@@ -1183,7 +1179,7 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
}
while( aLine.Search( "Prefix" ) == STRING_NOTFOUND );
- const ByteString aPrefix( getToken(aLine, 1, '"') );
+ const rtl::OString aPrefix( getToken(aLine, 1, '"') );
aIStm.Seek( nImgListStartPos );
do
commit 4521fc855b319bd8aa6583900d97c026bcc5f32f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Dec 12 09:17:17 2011 +0000
Resolves: fdo#42694 crash inserting table control
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index 30937db..92c29de 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -599,8 +599,10 @@ void BrowseBox::Resize()
nSBSize = (sal_uLong)(nSBSize * (double)GetZoom());
DoHideCursor( "Resize" );
- sal_uInt16 nOldVisibleRows =
- (sal_uInt16)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
+ sal_uInt16 nOldVisibleRows = 0;
+ //fdo#42694, post #i111125# GetDataRowHeight() can be 0
+ if (GetDataRowHeight())
+ nOldVisibleRows = (sal_uInt16)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
// did we need a horiz. scroll bar oder gibt es eine Control Area?
if ( !getDataWindow()->bNoHScroll &&
@@ -623,8 +625,10 @@ void BrowseBox::Resize()
Point( 0, GetTitleHeight() ),
Size( nDataWidth, nDataHeight ) );
- sal_uInt16 nVisibleRows =
- (sal_uInt16)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
+ sal_uInt16 nVisibleRows = 0;
+
+ if (GetDataRowHeight())
+ nVisibleRows = (sal_uInt16)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
// TopRow ist unveraendert, aber die Anzahl sichtbarer Zeilen hat sich
// geaendert
@@ -911,8 +915,13 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, sal_
long nDataRowHeigt = GetDataRowHeight();
// compute relative rows to redraw
- sal_uLong nRelTopRow = _bForeignDevice ? 0 : ((sal_uLong)_rRect.Top() / nDataRowHeigt);
- sal_uLong nRelBottomRow = (sal_uLong)(_bForeignDevice ? aOverallAreaSize.Height() : _rRect.Bottom()) / nDataRowHeigt;
+ sal_uLong nRelTopRow = 0;
+ sal_uLong nRelBottomRow = aOverallAreaSize.Height();
+ if (!_bForeignDevice && nDataRowHeigt)
+ {
+ nRelTopRow = ((sal_uLong)_rRect.Top() / nDataRowHeigt);
+ nRelBottomRow = (sal_uLong)(_rRect.Bottom()) / nDataRowHeigt;
+ }
// cache frequently used values
Point aPos( aOverallAreaPos.X(), nRelTopRow * nDataRowHeigt + aOverallAreaPos.Y() );
@@ -1182,11 +1191,16 @@ void BrowseBox::UpdateScrollbars()
if (IsZoom())
nCornerSize = (sal_uLong)(nCornerSize * (double)GetZoom());
- // needs VScroll?
- long nMaxRows = (pDataWin->GetSizePixel().Height()) / GetDataRowHeight();
- sal_Bool bNeedsVScroll = getDataWindow()->bAutoVScroll
- ? nTopRow || ( nRowCount > nMaxRows )
- : !getDataWindow()->bNoVScroll;
+ sal_Bool bNeedsVScroll = sal_False;
+ long nMaxRows = 0;
+ if (GetDataRowHeight())
+ {
+ // needs VScroll?
+ nMaxRows = (pDataWin->GetSizePixel().Height()) / GetDataRowHeight();
+ bNeedsVScroll = getDataWindow()->bAutoVScroll
+ ? nTopRow || ( nRowCount > nMaxRows )
+ : !getDataWindow()->bNoVScroll;
+ }
Size aDataWinSize = pDataWin->GetSizePixel();
if ( !bNeedsVScroll )
{
@@ -1269,8 +1283,8 @@ void BrowseBox::UpdateScrollbars()
pVScroll->SetPosSizePixel(
Point( aDataWinSize.Width(), GetTitleHeight() ),
Size( nCornerSize, aDataWinSize.Height()) );
- if ( nRowCount <
- long( aDataWinSize.Height() / GetDataRowHeight() ) )
+ long nLclDataRowHeight = GetDataRowHeight();
+ if ( nLclDataRowHeight > 0 && nRowCount < long( aDataWinSize.Height() / nLclDataRowHeight ) )
ScrollRows( -nTopRow );
if ( bNeedsVScroll && !pVScroll->IsVisible() )
pVScroll->Show();
commit 54747f3087e50c5e45ac2d051f455569d45a1c74
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Dec 12 09:07:57 2011 +0000
aPathName unused
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index 2aaf9a6..a638a2c 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -630,7 +630,6 @@ ERRTYPE RscCompiler :: IncludeParser( sal_uLong lFileKey )
else
{
RscFile * pFNTmp;
- ByteString aPathName;
RscDepend * pDep;
RscFileInst aFileInst( pTC, lFileKey, lFileKey, finput );
commit 9e4028b4fce0c93ae08005ae4f77c4154a42a08d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Dec 12 09:07:08 2011 +0000
aString unused
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index a7bada7..2aaf9a6 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -118,7 +118,6 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
char * pStr;
char ** ppStr;
RscPtrPtr aCmdLine; // Kommandozeile
- ByteString aString;
sal_uInt32 i;
sal_Bool bOutputSrsIsSet = sal_False;
commit 38d2abde15fb4954a763bd31921a78ea660e54e5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Dec 10 22:51:57 2011 +0000
sVersion, from WORK_STAMP doesn't get used
diff --git a/l10ntools/inc/srciter.hxx b/l10ntools/inc/srciter.hxx
index 5a1db39..237e7a0 100644
--- a/l10ntools/inc/srciter.hxx
+++ b/l10ntools/inc/srciter.hxx
@@ -46,7 +46,7 @@ protected:
bool bSkipLinks;
public:
- SourceTreeIterator( const ByteString &rRootDirectory, const ByteString &rVersion );
+ SourceTreeIterator(const rtl::OString &rRootDirectory);
virtual ~SourceTreeIterator();
sal_Bool StartExecute();
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx
index 53df0a1..992683a 100644
--- a/l10ntools/source/localize.cxx
+++ b/l10ntools/source/localize.cxx
@@ -205,7 +205,7 @@ private:
);
void WorkOnDirectory( const ByteString &rDirectory );
public:
- SourceTreeLocalizer( const ByteString &rRoot, const ByteString &rVersion , bool skip_links );
+ SourceTreeLocalizer(const ByteString &rRoot, bool skip_links);
~SourceTreeLocalizer();
void SetLanguageRestriction( const ByteString& rRestrictions )
@@ -216,15 +216,12 @@ public:
virtual void OnExecuteDirectory( const rtl::OUString &rDirectory );
};
-/*****************************************************************************/
-SourceTreeLocalizer::SourceTreeLocalizer(
- const ByteString &rRoot, const ByteString &rVersion, bool skip_links )
-/*****************************************************************************/
- : SourceTreeIterator( rRoot, rVersion ),
- nMode( LOCALIZE_NONE ),
- nFileCnt( 0 )
+SourceTreeLocalizer::SourceTreeLocalizer(const ByteString &rRoot, bool skip_links)
+ : SourceTreeIterator(rRoot)
+ , nMode( LOCALIZE_NONE )
+ , nFileCnt( 0 )
{
- bSkipLinks = skip_links ;
+ bSkipLinks = skip_links ;
}
/*****************************************************************************/
@@ -594,13 +591,6 @@ int _cdecl main( int argc, char *argv[] )
else
return Error();
- ByteString sVersion( Export::GetEnv( "WORK_STAMP" ));
-
- if ( !sVersion.Len() ) {
- fprintf( stderr, "ERROR: No environment set!\n" );
- return 1;
- }
-
DirEntry aEntry( String( sFileName , RTL_TEXTENCODING_ASCII_US ));
aEntry.ToAbs();
String sFullEntry = aEntry.GetFull();
@@ -610,7 +600,7 @@ int _cdecl main( int argc, char *argv[] )
string pwd;
Export::getCurrentDir( pwd );
cout << "Localizing directory " << pwd << "\n";
- SourceTreeLocalizer aIter( ByteString( pwd.c_str() ) , sVersion , bSkipLinks );
+ SourceTreeLocalizer aIter( ByteString( pwd.c_str() ) , bSkipLinks );
aIter.SetLanguageRestriction( sLanguages );
aIter.Extract( sFileName );
printf("\n%d files found!\n",aIter.GetFileCnt());
diff --git a/l10ntools/source/srciter.cxx b/l10ntools/source/srciter.cxx
index 829da3a..4b89c65 100644
--- a/l10ntools/source/srciter.cxx
+++ b/l10ntools/source/srciter.cxx
@@ -35,15 +35,10 @@
// class SourceTreeIterator
//
-/*****************************************************************************/
-SourceTreeIterator::SourceTreeIterator(
- const ByteString &rRootDirectory, const ByteString &rVersion )
-/*****************************************************************************/
- : bInExecute( sal_False )
+SourceTreeIterator::SourceTreeIterator(const rtl::OString &rRootDirectory)
+ : bInExecute( sal_False )
{
- (void) rVersion ;
-
- rtl::OUString sRootDirectory( rRootDirectory.GetBuffer() , rRootDirectory.Len() , RTL_TEXTENCODING_UTF8 );
+ rtl::OUString sRootDirectory(rtl::OStringToOUString(rRootDirectory, RTL_TEXTENCODING_UTF8));
aRootDirectory = transex::Directory( sRootDirectory );
}
commit 8a418586ea319f7ca7394e5412501fb8faed8142
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Dec 10 22:38:20 2011 +0000
ByteString->rtl::OString
diff --git a/rsc/inc/rscconst.hxx b/rsc/inc/rscconst.hxx
index d1ebeef..22253b9 100644
--- a/rsc/inc/rscconst.hxx
+++ b/rsc/inc/rscconst.hxx
@@ -95,7 +95,7 @@ public:
class RscNameTable;
-sal_uInt32 GetLangId( const ByteString& alang);
+sal_uInt32 GetLangId( const rtl::OString& rLang);
class RscLangEnum : public RscEnum
{
diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index ffe61c3..2a5f606 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -63,7 +63,7 @@ struct RscSysEntry
{
sal_uInt32 nKey;
sal_uInt32 nRscTyp;
- ByteString aFileName;
+ rtl::OString aFileName;
sal_uInt32 nTyp;
sal_uInt32 nRefId;
};
@@ -73,15 +73,15 @@ typedef ::std::vector< RscSysEntry* > RscSysList;
class RscTypCont
{
CharSet nSourceCharSet;
- sal_uInt32 nMachineId; // Globaler Maschinentyp
+ sal_uInt32 nMachineId; // Globaler Maschinentyp
RSCBYTEORDER_TYPE nByteOrder; // Intel oder
- ByteString aLanguage; // output language
+ rtl::OString aLanguage; // output language
std::vector< sal_uInt32 > aLangFallbacks; // language fallback list (entry 0 is language itself)
- ByteString aSearchPath; // Suchen der Bitmap, Icon, Pointer
- ByteString aSysSearchPath; // aSearchPath plus language specific paths
- sal_uInt32 nUniqueId; // eindeutiger Id fuer Systemresourcen
- sal_uLong nFilePos; // Position in der Datei ( MTF )
- sal_uInt32 nPMId; // eindeutiger Id fuer PM-Rseourcefile
+ rtl::OString aSearchPath; // Suchen der Bitmap, Icon, Pointer
+ rtl::OString aSysSearchPath; // aSearchPath plus language specific paths
+ sal_uInt32 nUniqueId; // eindeutiger Id fuer Systemresourcen
+ sal_uLong nFilePos; // Position in der Datei ( MTF )
+ sal_uInt32 nPMId; // eindeutiger Id fuer PM-Rseourcefile
// muss groesser als RSC_VERSIONCONTROL_ID sein
RscTop * pRoot; // Zeiger auf die Wurzel vom Typenbaum
RSCINST aVersion; // Versionskontrollinstanz
@@ -301,7 +301,7 @@ public:
std::map<sal_uInt64, sal_uLong> aIdTranslator; //Ordnet Resourcetypen und Id's einen Id zu
//(unter PM), oder eine Dateiposition (MTF)
- RscTypCont( RscError *, RSCBYTEORDER_TYPE, const ByteString & rSearchPath, sal_uInt32 nFlags );
+ RscTypCont( RscError *, RSCBYTEORDER_TYPE, const rtl::OString& rSearchPath, sal_uInt32 nFlags );
~RscTypCont();
Atom AddLanguage( const char* );
@@ -326,9 +326,9 @@ public:
nSourceCharSet = aCharSet;
return aOld;
}
- void SetSearchPath( const ByteString & rStr) { aSearchPath = rStr; }
- ByteString GetSearchPath() const { return aSearchPath; }
- void SetSysSearchPath( const ByteString& rStr ) { aSysSearchPath = rStr; }
+ void SetSearchPath( const rtl::OString& rStr) { aSearchPath = rStr; }
+ rtl::OString GetSearchPath() const { return aSearchPath; }
+ void SetSysSearchPath( const rtl::OString& rStr ) { aSysSearchPath = rStr; }
void InsertType( RscTop * pType )
{
aBaseLst.push_back( pType );
@@ -345,7 +345,7 @@ public:
CharSet nCharSet, sal_Bool bName = sal_True );
ERRTYPE WriteHxx( FILE * fOutput, sal_uLong nFileKey);
ERRTYPE WriteCxx( FILE * fOutput, sal_uLong nFileKey,
- const ByteString & rHxxName );
+ const rtl::OString& rHxxName );
void WriteSyntax( FILE * fOutput );
void WriteRcCtor( FILE * fOutput );
sal_uInt32 PutTranslatorKey( sal_uInt64 nKey );
diff --git a/rsc/inc/rscdef.hxx b/rsc/inc/rscdef.hxx
index e516b01..ed9a9bd 100644
--- a/rsc/inc/rscdef.hxx
+++ b/rsc/inc/rscdef.hxx
@@ -105,7 +105,7 @@ public:
static void SetNames( sal_Bool bSet = sal_True );
operator sal_Int32() const; // Gibt Nummer zurueck
- ByteString GetName() const; // Gibt den Namen des Defines zurueck
+ rtl::OString GetName() const; // Gibt den Namen des Defines zurueck
sal_Bool operator < ( const RscId& rRscId ) const;
sal_Bool operator > ( const RscId& rRscId ) const;
sal_Bool operator == ( const RscId& rRscId ) const;
@@ -130,16 +130,16 @@ friend class RscId;
RscExpression * pExp; // Ausdruck
protected:
- RscDefine( sal_uLong lFileKey, const ByteString & rDefName,
+ RscDefine( sal_uLong lFileKey, const rtl::OString& rDefName,
sal_Int32 lDefId );
- RscDefine( sal_uLong lFileKey, const ByteString & rDefName,
+ RscDefine( sal_uLong lFileKey, const rtl::OString& rDefName,
RscExpression * pExpression );
~RscDefine();
void IncRef(){ nRefCount++; }
sal_uInt32 GetRefCount() const { return nRefCount; }
void DecRef();
void DefineToNumber();
- void SetName( const ByteString & rNewName ){ aName = rNewName; }
+ void SetName(const rtl::OString& rNewName) { m_aName = rNewName; }
using StringNode::Search;
public:
@@ -147,7 +147,7 @@ public:
sal_uLong GetFileKey() const { return lFileKey; }
sal_Bool Evaluate();
sal_Int32 GetNumber() const { return lId; }
- ByteString GetMacro();
+ rtl::OString GetMacro();
};
typedef ::std::vector< RscDefine* > RscSubDefList;
@@ -158,9 +158,9 @@ friend class RscFileTab;
private:
RscSubDefList maList;
// pExpression wird auf jedenfall Eigentum der Liste
- RscDefine * New( sal_uLong lFileKey, const ByteString & rDefName,
+ RscDefine * New( sal_uLong lFileKey, const rtl::OString& rDefName,
sal_Int32 lDefId, size_t lPos );
- RscDefine * New( sal_uLong lFileKey, const ByteString & rDefName,
+ RscDefine * New( sal_uLong lFileKey, const rtl::OString& rDefName,
RscExpression * pExpression, size_t lPos );
sal_Bool Remove();
size_t GetPos( RscDefine* item ) {
@@ -184,7 +184,7 @@ public:
RscExpType aRE );
~RscExpression();
sal_Bool Evaluate( sal_Int32 * pValue );
- ByteString GetMacro();
+ rtl::OString GetMacro();
};
/********************** R S C F I L E ************************************/
@@ -254,9 +254,9 @@ public:
sal_Bool TestDef( sal_uLong lFileKey, size_t lPos,
const RscExpression * pExpDec );
- RscDefine * NewDef( sal_uLong lKey, const ByteString & rDefName,
+ RscDefine * NewDef( sal_uLong lKey, const rtl::OString& rDefName,
sal_Int32 lId, sal_uLong lPos );
- RscDefine * NewDef( sal_uLong lKey, const ByteString & rDefName,
+ RscDefine * NewDef( sal_uLong lKey, const rtl::OString& rDefName,
RscExpression *, sal_uLong lPos );
// Alle Defines die in dieser Datei Definiert sind loeschen
diff --git a/rsc/inc/rscrsc.hxx b/rsc/inc/rscrsc.hxx
index 1f79a3e..7a14792 100644
--- a/rsc/inc/rscrsc.hxx
+++ b/rsc/inc/rscrsc.hxx
@@ -54,14 +54,14 @@ public:
rtl::OString aPath; // Liste der Pfade
RSCBYTEORDER_TYPE nByteOrder;
unsigned short nCommands; // Steuerbits
- ByteString aOutputLst; // Name der List-Ausgabedatei
- ByteString aOutputSrs; // Name der Srs-Ausgabedatei
- ByteString aOutputSrc; // Name der Src-Ausgabedatei
- ByteString aOutputRcCtor; // Name der Ctor-Ausgabedatei
- ByteString aOutputCxx; // Name der Cxx-Ausgabedatei
- ByteString aOutputHxx; // Name der Hxx-Ausgabedatei
- ByteString aTouchFile; // create this file when done in rsc2
- ByteString aILDir;
+ rtl::OString aOutputLst; // Name der List-Ausgabedatei
+ rtl::OString aOutputSrs; // Name der Srs-Ausgabedatei
+ rtl::OString aOutputSrc; // Name der Src-Ausgabedatei
+ rtl::OString aOutputRcCtor; // Name der Ctor-Ausgabedatei
+ rtl::OString aOutputCxx; // Name der Cxx-Ausgabedatei
+ rtl::OString aOutputHxx; // Name der Hxx-Ausgabedatei
+ rtl::OString aTouchFile; // create this file when done in rsc2
+ rtl::OString aILDir;
struct OutputFile
{
@@ -88,13 +88,13 @@ struct WriteRcContext;
class RscCompiler
{
private:
- ByteString aTmpOutputHxx; // Name der TempHxx-Ausgabedatei
- ByteString aTmpOutputCxx; // Name der TempCxx-Ausgabedatei
- ByteString aTmpOutputRcCtor; // Name der Temp Ctor-Ausgabedatei
- ByteString aTmpOutputSrc; // Name der TempSrc-Ausgabedatei
+ rtl::OString aTmpOutputHxx; // Name der TempHxx-Ausgabedatei
+ rtl::OString aTmpOutputCxx; // Name der TempCxx-Ausgabedatei
+ rtl::OString aTmpOutputRcCtor; // Name der Temp Ctor-Ausgabedatei
+ rtl::OString aTmpOutputSrc; // Name der TempSrc-Ausgabedatei
void CreateResFile( const char * pRc );
- void Append( const ByteString& rOutputSrs, const ByteString& rTmpFile );
+ void Append( const rtl::OString& rOutputSrs, const rtl::OString& rTmpFile );
bool GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile,
const WriteRcContext& rContext,
diff --git a/rsc/inc/rsctools.hxx b/rsc/inc/rsctools.hxx
index 7694af3..c326b1c 100644
--- a/rsc/inc/rsctools.hxx
+++ b/rsc/inc/rsctools.hxx
@@ -48,10 +48,10 @@ enum RSCBYTEORDER_TYPE { RSC_BIGENDIAN, RSC_LITTLEENDIAN, RSC_SYSTEMENDIAN };
#define ALIGNED_SIZE( nSize ) \
(nSize + sizeof( void * ) -1) / sizeof( void * ) * sizeof( void * )
/******************* F u n c t i o n F o r w a r d s *******************/
-ByteString GetTmpFileName();
-sal_Bool Append( ByteString aDestFile, ByteString aSourceFile );
-sal_Bool Append( FILE * fDest, ByteString aSourceFile );
-ByteString OutputFile( ByteString aInput, const char * ext );
+rtl::OString GetTmpFileName();
+sal_Bool Append(const rtl::OString &rDestFile, const rtl::OString &rSourceFile);
+sal_Bool Append(FILE * fDest, rtl::OString &raSourceFile);
+rtl::OString OutputFile(const rtl::OString &rInput, const char * ext);
char * ResponseFile( RscPtrPtr * ppCmd, char ** ppArgv,
sal_uInt32 nArgc );
void RscExit( sal_uInt32 nExit );
diff --git a/rsc/inc/rsctop.hxx b/rsc/inc/rsctop.hxx
index 77e3204..6b627b1 100644
--- a/rsc/inc/rsctop.hxx
+++ b/rsc/inc/rsctop.hxx
@@ -57,9 +57,9 @@ protected:
RscTop * pSuperCl = NULL );
public:
- ByteString aCallPar1; // Klassenaufruf ohne Typen bis ResId
- ByteString aCallPar2; // Klassenaufruf ohne Typen ab ResId
- ByteString aCallParType; // Klassenaufruf mit Typen
+ rtl::OString aCallPar1; // Klassenaufruf ohne Typen bis ResId
+ rtl::OString aCallPar2; // Klassenaufruf ohne Typen ab ResId
+ rtl::OString aCallParType; // Klassenaufruf mit Typen
void SetSuperClass( RscTop * pClass )
{
@@ -74,10 +74,10 @@ public:
sal_Bool InHierarchy( RscTop * pClass );
sal_Bool IsCodeWriteable() const
{
- return( 0 != aCallParType.Len() );
+ return( 0 != aCallParType.getLength() );
}
- void SetCallPar( const ByteString & rPar1, const ByteString & rPar2,
- const ByteString & rParType );
+ void SetCallPar( const rtl::OString& rPar1, const rtl::OString& rPar2,
+ const rtl::OString& rParType );
void SetRefClass( RscTop * pRef ) { pRefClass = pRef; }
RscTop* GetRefClass() const { return pRefClass; }
virtual RSCCLASS_TYPE GetClassType() const = 0;
diff --git a/rsc/inc/rsctree.hxx b/rsc/inc/rsctree.hxx
index 8f94b50..b882b33 100644
--- a/rsc/inc/rsctree.hxx
+++ b/rsc/inc/rsctree.hxx
@@ -104,14 +104,14 @@ class StringNode : public NameNode
protected:
using NameNode::Search;
- ByteString aName;
+ rtl::OString m_aName;
public:
- StringNode(){};
- StringNode( const ByteString & rStr ) { aName = rStr; }
+ StringNode() {}
+ StringNode(const rtl::OString& rStr) { m_aName = rStr; }
StringNode* Search( const char * ) const;
- ByteString GetName() const { return aName; }
+ rtl::OString GetName() const { return m_aName; }
};
#endif // _RSCTREE_HXX
diff --git a/rsc/source/parser/erscerr.cxx b/rsc/source/parser/erscerr.cxx
index 59f179f..0b57388 100644
--- a/rsc/source/parser/erscerr.cxx
+++ b/rsc/source/parser/erscerr.cxx
@@ -425,7 +425,7 @@ void RscError::ErrorFormat( const ERRTYPE& rError, RscTop * pClass,
StdLstErr( ", " );
}
if( aId.IsId() )
- StdLstErr( aId.GetName().GetBuffer() );
+ StdLstErr( aId.GetName().getStr() );
StdLstErr( "):\n" );
}
else
diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx
index ea229cd..00ec27b 100644
--- a/rsc/source/parser/rscdb.cxx
+++ b/rsc/source/parser/rscdb.cxx
@@ -56,7 +56,7 @@ using ::rtl::OStringBuffer;
*************************************************************************/
RscTypCont :: RscTypCont( RscError * pErrHdl,
RSCBYTEORDER_TYPE nOrder,
- const ByteString & rSearchPath,
+ const rtl::OString& rSearchPath,
sal_uInt32 nFlagsP )
:
nSourceCharSet( RTL_TEXTENCODING_UTF8 ),
@@ -328,7 +328,7 @@ sal_uInt32 RscTypCont :: PutSysName( sal_uInt32 nRscTyp, char * pFileName,
pSysEntry = aSysLst[ i ];
if( pSysEntry->nKey == 1 )
bId1 = sal_True;
- if( !strcmp( pSysEntry->aFileName.GetBuffer(), pFileName ) )
+ if( !strcmp( pSysEntry->aFileName.getStr(), pFileName ) )
if( pSysEntry->nRscTyp == nRscTyp
&& pSysEntry->nTyp == nConst
&& pSysEntry->nRefId == nId
@@ -832,14 +832,14 @@ ERRTYPE RscTypCont :: WriteHxx( FILE * fOutput, sal_uLong nFileKey )
|*
*************************************************************************/
ERRTYPE RscTypCont::WriteCxx( FILE * fOutput, sal_uLong nFileKey,
- const ByteString & rHxxName )
+ const rtl::OString& rHxxName )
{
RscEnumerateRef aEnumRef( this, pRoot, fOutput );
ERRTYPE aError;
fprintf( fOutput, "#include <string.h>\n" );
WriteInc( fOutput, nFileKey );
- if( rHxxName.Len() )
- fprintf( fOutput, "#include \"%s\"\n", rHxxName.GetBuffer() );
+ if( rHxxName.getLength() )
+ fprintf( fOutput, "#include \"%s\"\n", rHxxName.getStr() );
fprintf( fOutput, "\n\n" );
if( NOFILE_INDEX == nFileKey )
diff --git a/rsc/source/parser/rscibas.cxx b/rsc/source/parser/rscibas.cxx
index a7fdf0c..4e2ba9f 100644
--- a/rsc/source/parser/rscibas.cxx
+++ b/rsc/source/parser/rscibas.cxx
@@ -80,9 +80,9 @@ void RscTypCont::SETCONST( RscConst * pClass, Atom nName, sal_uInt32 nVal )
typedef boost::unordered_map< rtl::OString, sal_uInt32, rtl::OStringHash > langmap;
static langmap ULong_Iso_map;
-sal_uInt32 GetLangId( const ByteString& aLang )
+sal_uInt32 GetLangId(const rtl::OString &rLang)
{
- langmap::iterator pIter = ULong_Iso_map.find( aLang );
+ langmap::iterator pIter = ULong_Iso_map.find( rLang );
if ( pIter != ULong_Iso_map.end())
return pIter->second;
return 0;
diff --git a/rsc/source/parser/rscyacc.y b/rsc/source/parser/rscyacc.y
index 61f028e..6c401d5 100644
--- a/rsc/source/parser/rscyacc.y
+++ b/rsc/source/parser/rscyacc.y
@@ -419,7 +419,7 @@ resource_definition
}
| '#' DEFINE RSCDEFINE macro_expression
{
- pTC->pEH->Error( ERR_DOUBLEDEFINE, NULL, RscId(), $3->GetName().GetBuffer() );
+ pTC->pEH->Error( ERR_DOUBLEDEFINE, NULL, RscId(), $3->GetName().getStr() );
}
| '#' INCLUDE STRING
{
diff --git a/rsc/source/res/rscclass.cxx b/rsc/source/res/rscclass.cxx
index 678c88c..7e4ea5e 100644
--- a/rsc/source/res/rscclass.cxx
+++ b/rsc/source/res/rscclass.cxx
@@ -997,7 +997,7 @@ void RscClass::WriteRcAccess
)
{
fprintf( fOutput, "\t\tSet%s( %s ", pName, pHS->getString( GetId() ).getStr() );
- fprintf( fOutput, "%s ", aCallPar2.GetBuffer() );
+ fprintf( fOutput, "%s ", aCallPar2.getStr() );
fprintf( fOutput, "ResId( (RSHEADER_TYPE*)(pResData+nOffset) ) ) );\n" );
fprintf( fOutput, "\t\tnOffset += GetObjSizeRes( (RSHEADER_TYPE*)(pResData+nOffset) );\n" );
}
@@ -1011,12 +1011,12 @@ void RscClass::WriteRcCtor( FILE * fOutput, RscTypCont * pTC )
fprintf( fOutput, "%s::%s%s bFreeResource )",
pHS->getString( GetId() ).getStr(),
pHS->getString( GetId() ).getStr(),
- aCallParType.GetBuffer() );
+ aCallParType.getStr() );
if( GetSuperClass() )
{
// Superaufruf
fprintf( fOutput, "\n\t: %s", pHS->getString( GetSuperClass()->GetId() ).getStr() );
- fprintf( fOutput, "%s", GetSuperClass()->aCallPar1.GetBuffer() );
+ fprintf( fOutput, "%s", GetSuperClass()->aCallPar1.getStr() );
fprintf( fOutput, " rResId.SetRT2( 0x%lx ) )",
sal::static_int_cast< unsigned long >(GetTypId()) );
}
diff --git a/rsc/source/res/rsccont.cxx b/rsc/source/res/rsccont.cxx
index 3bed42f..e724721 100644
--- a/rsc/source/res/rsccont.cxx
+++ b/rsc/source/res/rsccont.cxx
@@ -816,7 +816,7 @@ void RscBaseCont::ContWriteRcAccess
else
{
fprintf( fOutput, "\t\tSet%s( %s ", pName, pHS->getString( GetId() ).getStr() );
- fprintf( fOutput, "%s ", aCallPar2.GetBuffer() );
+ fprintf( fOutput, "%s ", aCallPar2.getStr() );
fprintf( fOutput, "ResId( (RSHEADER_TYPE*)(pResData+nOffset) ) ) );\n" );
fprintf( fOutput, "\t\tnOffset += GetObjSizeRes( (RSHEADER_TYPE*)(pResData+nOffset) );\n" );
}
diff --git a/rsc/source/res/rscmgr.cxx b/rsc/source/res/rscmgr.cxx
index c88dad9..078be90 100644
--- a/rsc/source/res/rscmgr.cxx
+++ b/rsc/source/res/rscmgr.cxx
@@ -176,9 +176,9 @@ void RscMgr::WriteSrcHeader( const RSCINST & rInst, FILE * fOutput,
fprintf( fOutput, "%s %s",
pHS->getString( rInst.pClass->GetId() ).getStr(),
- (rId.GetName()).GetBuffer() );
+ (rId.GetName()).getStr() );
if( pClassData->aRefId.IsId() )
- fprintf( fOutput, ",%s", pClassData->aRefId.GetName().GetBuffer() );
+ fprintf( fOutput, ",%s", pClassData->aRefId.GetName().getStr() );
else
{
fprintf( fOutput, "\n" );
@@ -405,7 +405,7 @@ ERRTYPE RscMgr::WriteHxxHeader( const RSCINST & rInst, FILE * fOutput,
fprintf( fOutput, "%s%s bFreeRes = TRUE )",
MakeName( pTC, rInst.pClass,
rId.GetName() ).getStr(),
- (rInst.pClass->aCallParType).GetBuffer() );
+ (rInst.pClass->aCallParType).getStr() );
fprintf( fOutput, ";\n};\n\n" );
}
};
@@ -466,11 +466,11 @@ ERRTYPE RscMgr::WriteCxxHeader( const RSCINST & rInst, FILE * fOutput,
fprintf( fOutput, "%s::%s",
MakeName( pTC, rInst.pClass, rId.GetName() ).getStr(),
MakeName( pTC, rInst.pClass, rId.GetName() ).getStr() );
- fprintf( fOutput, "%s", (rInst.pClass->aCallParType).GetBuffer() );
+ fprintf( fOutput, "%s", (rInst.pClass->aCallParType).getStr() );
if( GetCount( rInst ) )
fprintf( fOutput, " bFreeRes" );
fprintf( fOutput, " )\n : %s", pHS->getString( rInst.pClass->GetId() ).getStr() );
- fprintf( fOutput, "%s", (rInst.pClass->aCallPar1).GetBuffer() );
+ fprintf( fOutput, "%s", (rInst.pClass->aCallPar1).getStr() );
fprintf( fOutput, " rResId )" );
aError = RscClass::WriteCxx( rInst, fOutput, pTC, rId );
@@ -514,8 +514,8 @@ ERRTYPE RscMgr::WriteCxx( const RSCINST & rInst, FILE * fOutput,
{
fprintf( fOutput, ",\n a%s",
MakeName( pTC, rInst.pClass, rId.GetName() ).getStr() );
- fprintf( fOutput, "%s", (rInst.pClass->aCallPar2).GetBuffer() );
- fprintf( fOutput, " ResId( %s ) )", (rId.GetName()).GetBuffer() );
+ fprintf( fOutput, "%s", (rInst.pClass->aCallPar2).getStr() );
+ fprintf( fOutput, " ResId( %s ) )", (rId.GetName()).getStr() );
return ERR_OK;
}
diff --git a/rsc/source/res/rscrange.cxx b/rsc/source/res/rscrange.cxx
index e78011b..72a56c1 100644
--- a/rsc/source/res/rscrange.cxx
+++ b/rsc/source/res/rscrange.cxx
@@ -558,7 +558,7 @@ ERRTYPE RscIdRange::GetRef( const RSCINST & rInst, RscId * pRscId ){
void RscIdRange::WriteSrc( const RSCINST & rInst, FILE * fOutput,
RscTypCont *, sal_uInt32, const char * )
{
- fprintf( fOutput, "%s", ((RscId *)rInst.pData)->GetName().GetBuffer() );
+ fprintf( fOutput, "%s", ((RscId *)rInst.pData)->GetName().getStr() );
}
/*************************************************************************
diff --git a/rsc/source/res/rscstr.cxx b/rsc/source/res/rscstr.cxx
index d19aa82..18447c6 100644
--- a/rsc/source/res/rscstr.cxx
+++ b/rsc/source/res/rscstr.cxx
@@ -235,7 +235,7 @@ void RscString::WriteSrc( const RSCINST & rInst, FILE * fOutput,
if ( ((RscStringInst *)rInst.pData)->aRefId.IsId() )
{
fprintf( fOutput, "%s",
- ((RscStringInst *)rInst.pData)->aRefId.GetName().GetBuffer() );
+ ((RscStringInst *)rInst.pData)->aRefId.GetName().getStr() );
}
else
{
diff --git a/rsc/source/res/rsctop.cxx b/rsc/source/res/rsctop.cxx
index 2bc78f3..c5ffa5a 100644
--- a/rsc/source/res/rsctop.cxx
+++ b/rsc/source/res/rsctop.cxx
@@ -58,8 +58,8 @@ RscTop::RscTop( Atom nId, sal_uInt32 nTypIdent, RscTop * pSuperCl )
|* RscTop::SetCallPar()
|*
*************************************************************************/
-void RscTop::SetCallPar( const ByteString & rPar1, const ByteString & rPar2,
- const ByteString & rParType )
+void RscTop::SetCallPar(const rtl::OString& rPar1, const rtl::OString& rPar2,
+ const rtl::OString& rParType)
{
aCallPar1 = rPar1;
aCallPar2 = rPar2;
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index ee33b6c..a7bada7 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -284,7 +284,7 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
}
else if( !rsc_stricmp( (*ppStr) + 1, "lg" ) )
{
- m_aOutputFiles.back().aLangName = ByteString();
+ m_aOutputFiles.back().aLangName = rtl::OString();
}
else if( !rsc_strnicmp( (*ppStr) + 1, "lg", 2 ) )
{
@@ -394,10 +394,10 @@ RscCompiler::RscCompiler( RscCmdLine * pLine, RscTypCont * pTypCont )
pCL = pLine;
pTC = pTypCont;
- if( pCL->aOutputLst.Len() )
+ if( pCL->aOutputLst.getLength() )
{
- if ( NULL == (fListing = fopen( pCL->aOutputLst.GetBuffer(), "w" )) )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), pCL->aOutputLst.GetBuffer() );
+ if ( NULL == (fListing = fopen( pCL->aOutputLst.getStr(), "w" )) )
+ pTC->pEH->FatalError( ERR_OPENFILE, RscId(), pCL->aOutputLst.getStr() );
pTC->pEH->SetListFile( fListing );
}
}
@@ -416,14 +416,14 @@ RscCompiler::~RscCompiler()
if( fExitFile )
fclose( fExitFile );
- if( aTmpOutputHxx.Len() )
- unlink( aTmpOutputHxx.GetBuffer() );
- if( aTmpOutputCxx.Len() )
- unlink( aTmpOutputCxx.GetBuffer() );
- if( aTmpOutputRcCtor.Len() )
- unlink( aTmpOutputRcCtor.GetBuffer() );
- if( aTmpOutputSrc.Len() )
- unlink( aTmpOutputSrc.GetBuffer() );
+ if( aTmpOutputHxx.getLength() )
+ unlink( aTmpOutputHxx.getStr() );
+ if( aTmpOutputCxx.getLength() )
+ unlink( aTmpOutputCxx.getStr() );
+ if( aTmpOutputRcCtor.getLength() )
+ unlink( aTmpOutputRcCtor.getStr() );
+ if( aTmpOutputSrc.getLength() )
+ unlink( aTmpOutputSrc.getStr() );
}
/*************************************************************************
@@ -510,21 +510,21 @@ ERRTYPE RscCompiler::Start()
*************************************************************************/
void RscCompiler::EndCompile()
{
- if( pCL->aOutputSrs.Len() && (pCL->nCommands & NOLINK_FLAG) )
+ if( pCL->aOutputSrs.getLength() && (pCL->nCommands & NOLINK_FLAG) )
{
pTC->pEH->StdOut( "Writing file ", RscVerbosityVerbose );
- pTC->pEH->StdOut( pCL->aOutputSrs.GetBuffer(), RscVerbosityVerbose );
+ pTC->pEH->StdOut( pCL->aOutputSrs.getStr(), RscVerbosityVerbose );
pTC->pEH->StdOut( ".\n", RscVerbosityVerbose );
// kopiere von TMP auf richtigen Namen
- unlink( pCL->aOutputSrs.GetBuffer() ); // Zieldatei loeschen
+ unlink( pCL->aOutputSrs.getStr() ); // Zieldatei loeschen
if( !(pCL->nCommands & NOSYNTAX_FLAG) )
{
FILE * foutput;
RscFile * pFN;
- if( NULL == (foutput = fopen( pCL->aOutputSrs.GetBuffer(), "w" )) )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), pCL->aOutputSrs.GetBuffer() );
+ if( NULL == (foutput = fopen( pCL->aOutputSrs.getStr(), "w" )) )
+ pTC->pEH->FatalError( ERR_OPENFILE, RscId(), pCL->aOutputSrs.getStr() );
else
{
// Schreibe Datei
@@ -544,64 +544,64 @@ void RscCompiler::EndCompile()
};
}
- if ( aTmpOutputHxx.Len() )
+ if ( aTmpOutputHxx.getLength() )
{
pTC->pEH->StdOut( "Writing file ", RscVerbosityVerbose );
- pTC->pEH->StdOut( pCL->aOutputHxx.GetBuffer(), RscVerbosityVerbose );
+ pTC->pEH->StdOut( pCL->aOutputHxx.getStr(), RscVerbosityVerbose );
pTC->pEH->StdOut( ".\n", RscVerbosityVerbose );
// kopiere von TMP auf richtigen Namen
- unlink( pCL->aOutputHxx.GetBuffer() ); // Zieldatei loeschen
+ unlink( pCL->aOutputHxx.getStr() ); // Zieldatei loeschen
Append( pCL->aOutputHxx, aTmpOutputHxx );
- unlink( aTmpOutputHxx.GetBuffer() );// TempDatei loeschen
- aTmpOutputHxx = ByteString();
+ unlink( aTmpOutputHxx.getStr() );// TempDatei loeschen
+ aTmpOutputHxx = rtl::OString();
}
- if( aTmpOutputCxx.Len() )
+ if( aTmpOutputCxx.getLength() )
{
pTC->pEH->StdOut( "Writing file ", RscVerbosityVerbose );
- pTC->pEH->StdOut( pCL->aOutputCxx.GetBuffer(), RscVerbosityVerbose );
+ pTC->pEH->StdOut( pCL->aOutputCxx.getStr(), RscVerbosityVerbose );
pTC->pEH->StdOut( ".\n", RscVerbosityVerbose );
// kopiere von TMP auf richtigen Namen
- unlink( pCL->aOutputCxx.GetBuffer() ); // Zieldatei loeschen
+ unlink( pCL->aOutputCxx.getStr() ); // Zieldatei loeschen
Append( pCL->aOutputCxx, aTmpOutputCxx );
- unlink( aTmpOutputCxx.GetBuffer() );// TempDatei loeschen
- aTmpOutputCxx = ByteString();
+ unlink( aTmpOutputCxx.getStr() );// TempDatei loeschen
+ aTmpOutputCxx = rtl::OString();
}
- if( aTmpOutputRcCtor.Len() )
+ if( aTmpOutputRcCtor.getLength() )
{
pTC->pEH->StdOut( "Writing file ", RscVerbosityVerbose );
- pTC->pEH->StdOut( pCL->aOutputRcCtor.GetBuffer(), RscVerbosityVerbose );
+ pTC->pEH->StdOut( pCL->aOutputRcCtor.getStr(), RscVerbosityVerbose );
pTC->pEH->StdOut( ".\n", RscVerbosityVerbose );
// kopiere von TMP auf richtigen Namen
- unlink( pCL->aOutputRcCtor.GetBuffer() ); // Zieldatei loeschen
+ unlink( pCL->aOutputRcCtor.getStr() ); // Zieldatei loeschen
Append( pCL->aOutputRcCtor, aTmpOutputRcCtor );
- unlink( aTmpOutputRcCtor.GetBuffer() );// TempDatei loeschen
- aTmpOutputRcCtor = ByteString();
+ unlink( aTmpOutputRcCtor.getStr() );// TempDatei loeschen
+ aTmpOutputRcCtor = rtl::OString();
}
- if( aTmpOutputSrc.Len() )
+ if( aTmpOutputSrc.getLength() )
{
// kopiere von TMP auf richtigen Namen
- unlink( pCL->aOutputSrc.GetBuffer() ); // Zieldatei loeschen
+ unlink( pCL->aOutputSrc.getStr() ); // Zieldatei loeschen
Append( pCL->aOutputSrc, aTmpOutputSrc );
- unlink( aTmpOutputSrc.GetBuffer() );// TempDatei loeschen
- aTmpOutputSrc = ByteString();
+ unlink( aTmpOutputSrc.getStr() );// TempDatei loeschen
+ aTmpOutputSrc = rtl::OString();
}
- if( pCL->aTouchFile.Len() )
+ if( pCL->aTouchFile.getLength() )
{
- FILE* fp = fopen( pCL->aTouchFile.GetBuffer(), "w" );
+ FILE* fp = fopen( pCL->aTouchFile.getStr(), "w" );
if( fp )
{
fprintf( fp, "Done\n" );
fclose( fp );
}
else
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), pCL->aTouchFile.GetBuffer() );
+ pTC->pEH->FatalError( ERR_OPENFILE, RscId(), pCL->aTouchFile.getStr() );
}
}
@@ -822,7 +822,7 @@ ERRTYPE RscCompiler::Link()
OSL_TRACE("temporary rc file: %s", aRcTmp.getStr());
OUString sOilDirUrl;
- if(pCL->aILDir.Len())
+ if(pCL->aILDir.getLength())
sOilDirUrl = lcl_getAbsoluteUrl(sPwdUrl, pCL->aILDir);
else
sOilDirUrl = sTempDirUrl;
@@ -953,11 +953,11 @@ ERRTYPE RscCompiler::Link()
}
// hxx-Datei schreiben
- if( pCL->aOutputHxx.Len() && aError.IsOk() )
+ if( pCL->aOutputHxx.getLength() && aError.IsOk() )
{
aTmpOutputHxx = ::GetTmpFileName();
- if ( NULL == (fExitFile = foutput = fopen( aTmpOutputHxx.GetBuffer(), "w" )) )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTmpOutputHxx.GetBuffer() );
+ if ( NULL == (fExitFile = foutput = fopen( aTmpOutputHxx.getStr(), "w" )) )
+ pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTmpOutputHxx.getStr() );
pTC->pEH->StdOut( "Generating .hxx file\n" );
@@ -969,11 +969,11 @@ ERRTYPE RscCompiler::Link()
}
// cxx-Datei schreiben
- if( pCL->aOutputCxx.Len() && aError.IsOk() )
+ if( pCL->aOutputCxx.getLength() && aError.IsOk() )
{
aTmpOutputCxx = ::GetTmpFileName();
- if ( NULL == (fExitFile = foutput = fopen( aTmpOutputCxx.GetBuffer(), "w" )) )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTmpOutputCxx.GetBuffer() );
+ if ( NULL == (fExitFile = foutput = fopen( aTmpOutputCxx.getStr(), "w" )) )
+ pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTmpOutputCxx.getStr() );
pTC->pEH->StdOut( "Generating .cxx file\n" );
@@ -993,11 +993,11 @@ ERRTYPE RscCompiler::Link()
}
// RcCtor-Datei schreiben
- if( pCL->aOutputRcCtor.Len() && aError.IsOk() )
+ if( pCL->aOutputRcCtor.getLength() && aError.IsOk() )
{
aTmpOutputRcCtor = ::GetTmpFileName();
- if ( NULL == (fExitFile = foutput = fopen( aTmpOutputRcCtor.GetBuffer(), "w" )) )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTmpOutputRcCtor.GetBuffer() );
+ if ( NULL == (fExitFile = foutput = fopen( aTmpOutputRcCtor.getStr(), "w" )) )
+ pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTmpOutputRcCtor.getStr() );
pTC->pEH->StdOut( "Generating .cxx ressource constructor file\n" );
@@ -1009,11 +1009,11 @@ ERRTYPE RscCompiler::Link()
}
// src-Datei schreiben
- if( pCL->aOutputSrc.Len() && aError.IsOk() )
+ if( pCL->aOutputSrc.getLength() && aError.IsOk() )
{
aTmpOutputSrc = ::GetTmpFileName();
- if ( NULL == (fExitFile = foutput = fopen( aTmpOutputSrc.GetBuffer(), "w" )) )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTmpOutputSrc.GetBuffer() );
+ if ( NULL == (fExitFile = foutput = fopen( aTmpOutputSrc.getStr(), "w" )) )
+ pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTmpOutputSrc.getStr() );
// Schreibe Datei
pTC->WriteSrc( foutput, NOFILE_INDEX, RTL_TEXTENCODING_UNICODE );
@@ -1033,15 +1033,14 @@ ERRTYPE RscCompiler::Link()
/* */
/* Description : appends text files */
/********************************************************************/
-void RscCompiler::Append( const ByteString& rOutputSrs,
- const ByteString& rTmpFile )
+void RscCompiler::Append( const rtl::OString& rOutputSrs,
+ const rtl::OString& rTmpFile )
{
if( !::Append( rOutputSrs, rTmpFile ) )
{
- ByteString aTemp = rOutputSrs;
- aTemp += " or ";
- aTemp += rTmpFile;
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTemp.GetBuffer() );
+ rtl::OStringBuffer aTemp(rOutputSrs);
+ aTemp.append(" or ").append(rTmpFile);
+ pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aTemp.getStr() );
}
}
@@ -1082,7 +1081,7 @@ bool RscCompiler::GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile,
const FileStat aFS( aAbsPath.GetFull() );
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "Searching image: %s\n", ByteString( aRelPath.GetFull(), RTL_TEXTENCODING_ASCII_US ).GetBuffer() );
+ fprintf( stderr, "Searching image: %s\n", rtl::OUStringToOString(aRelPath.GetFull(), RTL_TEXTENCODING_ASCII_US).getStr() );
#endif
if( aFS.IsKind( FSYS_KIND_FILE ) )
diff --git a/rsc/source/tools/rscdef.cxx b/rsc/source/tools/rscdef.cxx
index ce495e3..355a46d 100644
--- a/rsc/source/tools/rscdef.cxx
+++ b/rsc/source/tools/rscdef.cxx
@@ -165,7 +165,7 @@ RscId::operator sal_Int32() const
|* RscId::GetNames()
|*
*************************************************************************/
-ByteString RscId::GetName() const
+rtl::OString RscId::GetName() const
{
rtl::OStringBuffer aStr;
@@ -186,7 +186,7 @@ ByteString RscId::GetName() const
|* RscDefine::RscDefine()
|*
*************************************************************************/
-RscDefine::RscDefine( sal_uLong lKey, const ByteString & rDefName, sal_Int32 lDefId )
+RscDefine::RscDefine( sal_uLong lKey, const rtl::OString& rDefName, sal_Int32 lDefId )
: StringNode( rDefName )
{
nRefCount = 0;
@@ -195,7 +195,7 @@ RscDefine::RscDefine( sal_uLong lKey, const ByteString & rDefName, sal_Int32 lDe
pExp = NULL;
}
-RscDefine::RscDefine( sal_uLong lKey, const ByteString & rDefName,
+RscDefine::RscDefine( sal_uLong lKey, const rtl::OString& rDefName,
RscExpression * pExpression )
: StringNode( rDefName )
{
@@ -270,7 +270,7 @@ RscDefine * RscDefine::Search( const char * pStr ){
|* RscDefine::GetMacro()
|*
*************************************************************************/
-ByteString RscDefine::GetMacro()
+rtl::OString RscDefine::GetMacro()
{
if( pExp )
return pExp->GetMacro();
@@ -283,7 +283,7 @@ ByteString RscDefine::GetMacro()
|* RscDefineList::New()
|*
*************************************************************************/
-RscDefine * RscDefineList::New( sal_uLong lFileKey, const ByteString & rDefName,
+RscDefine * RscDefineList::New( sal_uLong lFileKey, const rtl::OString& rDefName,
sal_Int32 lDefId, size_t lPos )
{
RscDefine * pDef;
@@ -301,7 +301,7 @@ RscDefine * RscDefineList::New( sal_uLong lFileKey, const ByteString & rDefName,
return pDef;
}
-RscDefine * RscDefineList::New( sal_uLong lFileKey, const ByteString & rDefName,
+RscDefine * RscDefineList::New( sal_uLong lFileKey, const rtl::OString& rDefName,
RscExpression * pExpression, size_t lPos )
{
RscDefine * pDef;
@@ -339,8 +339,8 @@ void RscDefineList::WriteAll( FILE * fOutput )
for ( size_t i = 0, n = maList.size(); i < n; ++i ) {
RscDefine* pDefEle = maList[ i ];
fprintf( fOutput, "#define %s %s\n",
- pDefEle->GetName().GetBuffer(),
- pDefEle->GetMacro().GetBuffer()
+ pDefEle->GetName().getStr(),
+ pDefEle->GetMacro().getStr()
);
};
}
@@ -452,7 +452,7 @@ sal_Bool RscExpression::Evaluate( sal_Int32 * plValue ){
|* RscExpression::GetMacro()
|*
*************************************************************************/
-ByteString RscExpression::GetMacro()
+rtl::OString RscExpression::GetMacro()
{
rtl::OStringBuffer aLeft;
@@ -778,7 +778,7 @@ sal_Bool RscFileTab::TestDef( sal_uLong lFileKey, size_t lPos,
|* RscFileTab::NewDef()
|*
*************************************************************************/
-RscDefine * RscFileTab::NewDef( sal_uLong lFileKey, const ByteString & rDefName,
+RscDefine * RscFileTab::NewDef( sal_uLong lFileKey, const rtl::OString& rDefName,
sal_Int32 lId, sal_uLong lPos )
{
RscDefine * pDef = FindDef( rDefName );
@@ -802,7 +802,7 @@ RscDefine * RscFileTab::NewDef( sal_uLong lFileKey, const ByteString & rDefName,
|* RscFileTab::NewDef()
|*
*************************************************************************/
-RscDefine * RscFileTab::NewDef( sal_uLong lFileKey, const ByteString & rDefName,
+RscDefine * RscFileTab::NewDef( sal_uLong lFileKey, const rtl::OString& rDefName,
RscExpression * pExp, sal_uLong lPos )
{
RscDefine * pDef = FindDef( rDefName );
diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx
index c454607..70ef441 100644
--- a/rsc/source/tools/rsctools.cxx
+++ b/rsc/source/tools/rsctools.cxx
@@ -119,7 +119,7 @@ char* rsc_strdup( const char* pStr )
|* malloc allokiert
|*
*************************************************************************/
-ByteString GetTmpFileName()
+rtl::OString GetTmpFileName()
{
OUString aTmpURL, aTmpFile;
osl_createTempFile( NULL, NULL, &aTmpURL.pData );
@@ -135,10 +135,10 @@ ByteString GetTmpFileName()
/* */
/* Description : appends text files */
/********************************************************************/
-sal_Bool Append( FILE * fDest, ByteString aTmpFile )
+sal_Bool Append(FILE * fDest, const rtl::OString &rTmpFile)
{
#define MAX_BUF 4096
- FILE *fSource = fopen( aTmpFile.GetBuffer(), "rb" );
+ FILE *fSource = fopen(rTmpFile.getStr(), "rb");
if( !fDest || !fSource )
{
if( fSource )
@@ -161,11 +161,11 @@ sal_Bool Append( FILE * fDest, ByteString aTmpFile )
return sal_True;
}
-sal_Bool Append( ByteString aOutputSrs, ByteString aTmpFile )
+sal_Bool Append(const rtl::OString &rOutputSrs, const rtl::OString &rTmpFile)
{
- FILE * fDest = fopen( aOutputSrs.GetBuffer(), "ab" );
+ FILE * fDest = fopen(rOutputSrs.getStr(), "ab");
- sal_Bool bRet = Append( fDest, aTmpFile );
+ sal_Bool bRet = Append(fDest, rTmpFile);
if( fDest )
fclose( fDest );
@@ -182,10 +182,10 @@ sal_Bool Append( ByteString aOutputSrs, ByteString aTmpFile )
|* pExt, die Extension des Ausgabenamens
|*
*************************************************************************/
-ByteString OutputFile ( ByteString aInput, const char * pExt )
+rtl::OString OutputFile(const rtl::OString &rInput, const char * pExt)
{
- UniString aUniInput( aInput, RTL_TEXTENCODING_ASCII_US );
- DirEntry aFileName( aUniInput );
+ rtl::OUString aUniInput(rtl::OStringToOUString(rInput, RTL_TEXTENCODING_ASCII_US));
+ DirEntry aFileName(aUniInput);
UniString aExt( pExt, RTL_TEXTENCODING_ASCII_US );
aFileName.SetExtension( aExt );
diff --git a/rsc/source/tools/rsctree.cxx b/rsc/source/tools/rsctree.cxx
index 7531536..14f6a08 100644
--- a/rsc/source/tools/rsctree.cxx
+++ b/rsc/source/tools/rsctree.cxx
@@ -415,8 +415,8 @@ StringNode * StringNode::Search( const char * pSearch ) const{
*************************************************************************/
COMPARE StringNode::Compare( const NameNode * pSearch ) const
{
- int nCmp = strcmp( aName.GetBuffer(),
- ((const StringNode *)pSearch)->aName.GetBuffer() );
+ int nCmp = strcmp( m_aName.getStr(),
+ ((const StringNode *)pSearch)->m_aName.getStr() );
if( nCmp < 0 )
return LESS;
else if( nCmp > 0 )
@@ -428,7 +428,7 @@ COMPARE StringNode::Compare( const NameNode * pSearch ) const
COMPARE StringNode::Compare( const void * pSearch ) const
{
// pSearch ist ein Zeiger auf const char *
- int nCmp = strcmp( aName.GetBuffer(), (const char *)pSearch );
+ int nCmp = strcmp( m_aName.getStr(), (const char *)pSearch );
if( nCmp < 0 )
return LESS;
commit a28c265ea4bf318cd993673cab88f609d7294220
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Dec 9 20:57:29 2011 +0000
de-ICC this for maximum readability
diff --git a/sw/inc/ndole.hxx b/sw/inc/ndole.hxx
index d66f387..f09f39e 100644
--- a/sw/inc/ndole.hxx
+++ b/sw/inc/ndole.hxx
@@ -156,11 +156,12 @@ public:
};
-// Inline methods from Node.hxx - we know TxtNode only here!!
+// Inline methods from Node.hxx
inline SwOLENode *SwNode::GetOLENode()
{
return ND_OLENODE == nNodeType ? (SwOLENode*)this : 0;
}
+
inline const SwOLENode *SwNode::GetOLENode() const
{
return ND_OLENODE == nNodeType ? (const SwOLENode*)this : 0;
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 381fc85..52bae7a 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -843,18 +843,16 @@ inline SwTxtFmtColl* SwTxtNode::GetTxtColl() const
return static_cast<SwTxtFmtColl*>(const_cast<SwModify*>(GetRegisteredIn()));
}
-// For IBM-Compiler do not inline this because of 42876
-#ifndef ICC
-// Inline methods from Node.hxx - we know TxtNode only now!!
-inline SwTxtNode *SwNode::GetTxtNode()
+// Inline methods from Node.hxx
+inline SwTxtNode *SwNode::GetTxtNode()
{
return ND_TEXTNODE == nNodeType ? static_cast<SwTxtNode*>(this) : 0;
}
-inline const SwTxtNode *SwNode::GetTxtNode() const
+
+inline const SwTxtNode *SwNode::GetTxtNode() const
{
return ND_TEXTNODE == nNodeType ? static_cast<const SwTxtNode*>(this) : 0;
}
-#endif
inline void
SwTxtNode::CutText(SwTxtNode * const pDest, const SwIndex & rDestStart,
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index ec8f58f..bbe3c59 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -149,21 +149,14 @@ public:
inline const SwCntntNode *GetCntntNode() const;
inline SwEndNode *GetEndNode();
inline const SwEndNode *GetEndNode() const;
-#ifndef ICC
- inline
-#endif
- SwTxtNode *GetTxtNode();
-
-#ifndef ICC
- inline
-#endif
- const SwTxtNode *GetTxtNode() const;
- inline SwOLENode *GetOLENode();
- inline const SwOLENode *GetOLENode() const;
- inline SwNoTxtNode *GetNoTxtNode();
- inline const SwNoTxtNode *GetNoTxtNode() const;
- inline SwGrfNode *GetGrfNode();
- inline const SwGrfNode *GetGrfNode() const;
+ inline SwTxtNode *GetTxtNode();
+ inline const SwTxtNode *GetTxtNode() const;
+ inline SwOLENode *GetOLENode();
+ inline const SwOLENode *GetOLENode() const;
+ inline SwNoTxtNode *GetNoTxtNode();
+ inline const SwNoTxtNode *GetNoTxtNode() const;
+ inline SwGrfNode *GetGrfNode();
+ inline const SwGrfNode *GetGrfNode() const;
inline SwTableNode *GetTableNode();
inline const SwTableNode *GetTableNode() const;
inline SwSectionNode *GetSectionNode();
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index ef91eb4..55c592c 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1955,20 +1955,6 @@ SwOLENodes* SwCntntNode::CreateOLENodesArray( const SwFmtColl& rColl, bool bOnly
return pNodes;
}
-//FEATURE::CONDCOLL
-// Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !!
-// os: nur fuer ICC, da der zum optimieren zu dumm ist
-#ifdef ICC
-SwTxtNode *SwNode::GetTxtNode()
-{
- return ND_TEXTNODE == nNodeType ? (SwTxtNode*)this : 0;
-}
-const SwTxtNode *SwNode::GetTxtNode() const
-{
- return ND_TEXTNODE == nNodeType ? (const SwTxtNode*)this : 0;
-}
-#endif
-
/*
* Document Interface Access
*/
diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx
index c9f6323..22dcd94 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -674,18 +674,6 @@ SvxCSS1MapEntry::SvxCSS1MapEntry( const String& rKey, const SfxItemSet& rItemSet
aKey.ToUpperAscii();
}
-#if defined( ICC )
-sal_Bool operator==( const SvxCSS1MapEntry& rE1, const SvxCSS1MapEntry& rE2 )
-{
- return rE1.aKey==rE2.aKey;
-}
-
-sal_Bool operator<( const SvxCSS1MapEntry& rE1, const SvxCSS1MapEntry& rE2 )
-{
- return rE1.aKey<rE2.aKey;
-}
-#endif
-
sal_Bool SvxCSS1Parser::StyleParsed( const CSS1Selector * /*pSelector*/,
SfxItemSet& /*rItemSet*/,
SvxCSS1PropertyInfo& /*rPropInfo*/ )
diff --git a/sw/source/filter/html/svxcss1.hxx b/sw/source/filter/html/svxcss1.hxx
index bcd7a28..1512fd7 100644
--- a/sw/source/filter/html/svxcss1.hxx
+++ b/sw/source/filter/html/svxcss1.hxx
@@ -196,7 +196,6 @@ public:
const SvxCSS1MapEntry& rE2 );
};
-#if !defined( ICC )
inline sal_Bool operator==( const SvxCSS1MapEntry& rE1, const SvxCSS1MapEntry& rE2 )
{
return rE1.aKey==rE2.aKey;
@@ -206,7 +205,6 @@ inline sal_Bool operator<( const SvxCSS1MapEntry& rE1, const SvxCSS1MapEntry& r
{
return rE1.aKey<rE2.aKey;
}
-#endif
// Diese Klasse bereitet den Output des CSS1-Parsers auf,
// indem die CSS1-Properties in SvxItem(Set)s umgewandelt werden.
commit f836ad5caa4f3b83d6382afdda5dbe18719f6096
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Dec 9 20:34:13 2011 +0000
de-obscure things direct ND_TEXTNODE id compare -> IsTxtNode
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index a461fb9..3a7becd 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -2581,7 +2581,7 @@ bool SwDoc::ContainsHiddenChars() const
for( sal_uLong n = GetNodes().Count(); n; )
{
SwNode* pNd = GetNodes()[ --n ];
- if ( ND_TEXTNODE == pNd->GetNodeType() &&
+ if ( pNd->IsTxtNode() &&
((SwTxtNode*)pNd)->HasHiddenCharAttribute( false ) )
return true;
}
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index a175104..ba4cfe2 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -3251,14 +3251,16 @@ void SwRedline::InvalidateRange() // das Layout anstossen
SwUpdateAttr aHt( 0, 0, RES_FMT_CHG );
SwNodes& rNds = GetDoc()->GetNodes();
- SwNode* pNd;
for( sal_uLong n = nSttNd; n <= nEndNd; ++n )
- if( ND_TEXTNODE == ( pNd = rNds[ n ] )->GetNodeType() )
+ {
+ SwNode* pNd = rNds[n];
+ if( pNd->IsTxtNode() )
{
aHt.nStart = n == nSttNd ? nSttCnt : 0;
aHt.nEnd = n == nEndNd ? nEndCnt : ((SwTxtNode*)pNd)->GetTxt().Len();
((SwTxtNode*)pNd)->ModifyNotification( &aHt, &aHt );
}
+ }
}
/*************************************************************************
commit f827f87ea390b14aff5a54065dfb59c2ab7e4c0b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Dec 9 15:26:26 2011 +0000
refactor ND_foo_NODE to be a little more readable
diff --git a/sw/inc/ndtyp.hxx b/sw/inc/ndtyp.hxx
index 9b37b35..db7bcd9 100644
--- a/sw/inc/ndtyp.hxx
+++ b/sw/inc/ndtyp.hxx
@@ -34,18 +34,20 @@
// IDs for different nodes. The member indicating the type of node is
// in base class.
const sal_uInt8 ND_ENDNODE = 0x01;
-const sal_uInt8 ND_STARTNODE = 0x02;
-const sal_uInt8 ND_TABLENODE = 0x06;
-const sal_uInt8 ND_TEXTNODE = 0x08;
+const sal_uInt8 ND_STARTNODE = 0x02;
+const sal_uInt8 ND_TABLEDUMMY = 0x04; //(ND_TABLENODE & ~ND_STARTNODE);
+const sal_uInt8 ND_TEXTNODE = 0x08;
const sal_uInt8 ND_GRFNODE = 0x10;
const sal_uInt8 ND_OLENODE = 0x20;
+const sal_uInt8 ND_SECTIONDUMMY = 0x40; //(ND_SECTIONNODE & ~ND_STARTNODE);
-const sal_uInt8 ND_CONTENTNODE = 0x38; // ContentNode (one of the 3 bits).
-const sal_uInt8 ND_NOTXTNODE = 0x30; // NoTxtNode (one of the 2 bits).
+const sal_uInt8 ND_TABLENODE = ND_TABLEDUMMY | ND_STARTNODE;
+const sal_uInt8 ND_SECTIONNODE = ND_SECTIONDUMMY | ND_STARTNODE;
-const sal_uInt8 ND_SECTIONNODE = 0x42;
-// For internal use only!!
-const sal_uInt8 ND_SECTIONDUMMY = 0x40; //(ND_SECTIONNODE & ~ND_STARTNODE);
+// NoTxtNode (if any of the 2 bits are set).
+const sal_uInt8 ND_NOTXTNODE = ND_GRFNODE | ND_OLENODE;
+// ContentNode (if any of the 3 bits are set).
+const sal_uInt8 ND_CONTENTNODE = ND_TEXTNODE | ND_NOTXTNODE;
// Special types of StartNodes that are not derivations but keep
// "sections" together.
More information about the Libreoffice-commits
mailing list