[Libreoffice-commits] core.git: 5 commits - comphelper/source dbaccess/source include/editeng include/formula include/svtools include/svx include/tools sc/inc sc/source sd/source sfx2/source svtools/source svx/source sw/inc sw/source tools/source vcl/source
Caolán McNamara
caolanm at redhat.com
Mon Oct 21 06:26:58 PDT 2013
comphelper/source/misc/string.cxx | 3
dbaccess/source/ui/browser/unodatbr.cxx | 8
include/editeng/editdata.hxx | 3
include/editeng/editeng.hxx | 1
include/editeng/svxacorr.hxx | 1
include/formula/FormulaCompiler.hxx | 1
include/svtools/simptabl.hxx | 2
include/svtools/treelist.hxx | 3
include/svx/ctredlin.hxx | 2
include/svx/gallery.hxx | 1
include/svx/nbdtmg.hxx | 1
include/svx/numfmtsh.hxx | 1
include/tools/string.hxx | 42 ----
sc/inc/column.hxx | 2
sc/inc/table.hxx | 2
sc/inc/userlist.hxx | 5
sc/source/core/data/column3.cxx | 6
sc/source/core/data/conditio.cxx | 19 -
sc/source/core/data/documen4.cxx | 2
sc/source/core/data/documen9.cxx | 2
sc/source/core/data/funcdesc.cxx | 2
sc/source/core/data/global.cxx | 6
sc/source/core/data/table3.cxx | 2
sc/source/core/tool/address.cxx | 1
sc/source/core/tool/autoform.cxx | 6
sc/source/core/tool/compiler.cxx | 1
sc/source/core/tool/rangelst.cxx | 96 +++++-----
sc/source/core/tool/userlist.cxx | 28 +-
sc/source/filter/excel/excel.cxx | 4
sc/source/filter/excel/fontbuff.cxx | 2
sc/source/filter/excel/impop.cxx | 2
sc/source/filter/excel/xelink.cxx | 2
sc/source/filter/ftools/ftools.cxx | 1
sc/source/filter/html/htmlexp.cxx | 2
sc/source/filter/inc/imp_op.hxx | 4
sc/source/filter/inc/lotform.hxx | 4
sc/source/filter/inc/lotimpop.hxx | 2
sc/source/filter/lotus/filter.cxx | 6
sc/source/filter/lotus/lotform.cxx | 2
sc/source/filter/lotus/lotimpop.cxx | 4
sc/source/filter/lotus/lotus.cxx | 4
sc/source/filter/lotus/op.cxx | 4
sc/source/ui/dbgui/scuiasciiopt.cxx | 2
sc/source/ui/docshell/docsh.cxx | 4
sc/source/ui/docshell/docsh8.cxx | 6
sc/source/ui/docshell/impex.cxx | 8
sc/source/ui/inc/asciiopt.hxx | 6
sc/source/ui/inc/docsh.hxx | 4
sc/source/ui/inc/imoptdlg.hxx | 2
sc/source/ui/inc/scuiasciiopt.hxx | 2
sc/source/ui/miscdlgs/acredlin.cxx | 28 +-
sc/source/ui/miscdlgs/solveroptions.cxx | 2
sd/source/ui/view/ViewShellBase.cxx | 2
sfx2/source/appl/appuno.cxx | 5
sfx2/source/appl/shutdownicon.cxx | 2
sfx2/source/dialog/templdlg.cxx | 4
sfx2/source/doc/objstor.cxx | 8
sfx2/source/menu/mnuitem.cxx | 2
svtools/source/contnr/fileview.cxx | 2
svtools/source/contnr/simptabl.cxx | 11 -
svtools/source/contnr/treelist.cxx | 24 +-
svtools/source/control/ctrltool.cxx | 8
svtools/source/graphic/provider.cxx | 76 +++----
svtools/source/misc/imagemgr.cxx | 2
svx/source/dialog/ctredlin.cxx | 16 -
svx/source/form/fmshimp.cxx | 2
svx/source/sidebar/nbdtmg.cxx | 9
svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx | 12 -
svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx | 2
sw/inc/iodetect.hxx | 2
sw/source/core/doc/tblafmt.cxx | 6
sw/source/core/inc/swfont.hxx | 8
sw/source/core/unocore/unocoll.cxx | 2
sw/source/core/unocore/unodraw.cxx | 2
sw/source/core/unocore/unoframe.cxx | 14 -
sw/source/core/unocore/unosett.cxx | 6
sw/source/filter/ascii/parasc.cxx | 4
sw/source/filter/basflt/iodetect.cxx | 4
sw/source/filter/inc/fltshell.hxx | 4
sw/source/filter/ww8/ww8par.cxx | 12 -
sw/source/filter/ww8/ww8par.hxx | 8
sw/source/filter/ww8/ww8par2.cxx | 6
sw/source/filter/ww8/ww8par5.cxx | 2
sw/source/filter/ww8/ww8par6.cxx | 6
sw/source/ui/config/uinums.cxx | 10 -
sw/source/ui/dbui/dbtree.cxx | 2
sw/source/ui/inc/insfnote.hxx | 4
sw/source/ui/shells/langhelper.cxx | 2
tools/source/string/strucvt.cxx | 25 --
tools/source/string/tustring.cxx | 2
vcl/source/gdi/outdev3.cxx | 35 +--
91 files changed, 319 insertions(+), 390 deletions(-)
New commits:
commit 6e03e292e5e887053dfd7746d6f9df12abc0bab7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Oct 21 11:41:47 2013 +0100
Related: fdo#38838 remove a pile of ctors
Change-Id: I5d19eadc3dc24b0aeeb61c677f440eef83af78c2
diff --git a/include/tools/string.hxx b/include/tools/string.hxx
index 6904e0e..9560220 100644
--- a/include/tools/string.hxx
+++ b/include/tools/string.hxx
@@ -99,44 +99,13 @@ private:
UniString& Assign( const OUString& rStr );
UniString& Append( const UniString& rStr );
-
- UniString( const int* pDummy ); // not implemented: to prevent UniString( NULL )
- UniString(int); // not implemented; to detect misuses of
- // UniString(sal_Unicode)
- void operator =(int); // not implemented; to detect misuses
- // of operator =(sal_Unicode)
- void Append(int); // not implemented; to detect misuses of
- // Append(sal_Unicode)
-
- //detect and reject use of RTL_CONSTASCII_STRINGPARAM instead of RTL_CONSTASCII_USTRINGPARAM
- TOOLS_DLLPRIVATE UniString( const sal_Char*, sal_Int32 );
-
- //detect and reject wrong way to attempt to create a UniString from a substring of
- //a OString
- TOOLS_DLLPRIVATE UniString(const OString& rByteStr, xub_StrLen nPos, xub_StrLen nLen,
- sal_uInt32 nCvtFlags = BYTESTRING_TO_UNISTRING_CVTFLAGS);
-
- //no longer implemented
- TOOLS_DLLPRIVATE UniString( const OString& rByteStr,
- rtl_TextEncoding eTextEncoding,
- sal_uInt32 nCvtFlags = BYTESTRING_TO_UNISTRING_CVTFLAGS );
- TOOLS_DLLPRIVATE UniString( const sal_Unicode* pCharStr );
- TOOLS_DLLPRIVATE UniString( const sal_Unicode* pCharStr, xub_StrLen nLen );
- TOOLS_DLLPRIVATE UniString( sal_Unicode c );
public:
UniString();
UniString( const ResId& rResId );
UniString( const UniString& rStr );
UniString( const UniString& rStr, xub_StrLen nPos, xub_StrLen nLen );
UniString( const OUString& rStr );
- UniString(char c); // ...but allow "UniString('a')"
- UniString( const sal_Char* pByteStr,
- rtl_TextEncoding eTextEncoding,
- sal_uInt32 nCvtFlags = BYTESTRING_TO_UNISTRING_CVTFLAGS );
- UniString( const sal_Char* pByteStr, xub_StrLen nLen,
- rtl_TextEncoding eTextEncoding,
- sal_uInt32 nCvtFlags = BYTESTRING_TO_UNISTRING_CVTFLAGS );
- ~UniString();
+ ~UniString();
operator OUString () const
{
diff --git a/tools/source/string/strucvt.cxx b/tools/source/string/strucvt.cxx
index f85d7d6..9ed5a20 100644
--- a/tools/source/string/strucvt.cxx
+++ b/tools/source/string/strucvt.cxx
@@ -17,31 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-UniString::UniString( const char* pByteStr,
- rtl_TextEncoding eTextEncoding, sal_uInt32 nCvtFlags )
-{
- DBG_ASSERT( pByteStr, "UniString::UniString() - pByteStr is NULL" );
-
- mpData = NULL;
- rtl_string2UString( (rtl_uString **)(&mpData),
- pByteStr, ImplStringLen( pByteStr ),
- eTextEncoding, nCvtFlags );
-}
-
-UniString::UniString( const char* pByteStr, xub_StrLen nLen,
- rtl_TextEncoding eTextEncoding, sal_uInt32 nCvtFlags )
-{
- DBG_ASSERT( pByteStr, "UniString::UniString() - pByteStr is NULL" );
-
- if ( nLen == STRING_LEN )
- nLen = ImplStringLen( pByteStr );
-
- mpData = NULL;
- rtl_string2UString( (rtl_uString **)(&mpData),
- pByteStr, nLen,
- eTextEncoding, nCvtFlags );
-}
-
UniString::UniString( const OUString& rStr )
: mpData(NULL)
{
diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx
index f4f3bd2..cc4f27d 100644
--- a/tools/source/string/tustring.cxx
+++ b/tools/source/string/tustring.cxx
@@ -45,8 +45,6 @@ DBG_NAME( UniString )
#include <strimp.cxx>
#include <strucvt.cxx>
-UniString::UniString(char c): mpData(ImplAllocData(1)) { mpData->maStr[0] = c; }
-
StringCompare STRING::CompareTo( const STRING& rStr, xub_StrLen nLen ) const
{
if ( mpData == rStr.mpData )
commit 42def53fb1fee0b4e57279d11c05e54601aeed1b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Oct 21 12:41:25 2013 +0100
remove unnecessary tools/string.hxx includes
Change-Id: I8ed341aeef90584dfc545a794f999e3adc08dd72
diff --git a/include/editeng/editdata.hxx b/include/editeng/editdata.hxx
index f0485a2..0ba2538 100644
--- a/include/editeng/editdata.hxx
+++ b/include/editeng/editdata.hxx
@@ -21,7 +21,8 @@
#ifndef _MyEDITDATA_HXX
#define _MyEDITDATA_HXX
-#include <tools/string.hxx>
+#include <rtl/ustring.hxx>
+#include <tools/solar.h>
#include "editeng/editengdllapi.h"
class SfxItemSet;
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx
index 325af9e..5500b13 100644
--- a/include/editeng/editeng.hxx
+++ b/include/editeng/editeng.hxx
@@ -31,6 +31,7 @@
#include <i18nlangtag/lang.h>
#include "editeng/editengdllapi.h"
+#include <tools/lineend.hxx>
#include <tools/rtti.hxx> // due to typedef TypeId
#include <editeng/eedata.hxx>
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx
index 846e15f..cb22d3f 100644
--- a/include/editeng/svxacorr.hxx
+++ b/include/editeng/svxacorr.hxx
@@ -27,7 +27,6 @@
#include <i18nlangtag/languagetag.hxx>
#include <tools/time.hxx>
#include <tools/date.hxx>
-#include <tools/string.hxx>
#include <editeng/swafopt.hxx>
#include "editeng/editengdllapi.h"
diff --git a/include/formula/FormulaCompiler.hxx b/include/formula/FormulaCompiler.hxx
index d5509a9..ae46a6d 100644
--- a/include/formula/FormulaCompiler.hxx
+++ b/include/formula/FormulaCompiler.hxx
@@ -34,7 +34,6 @@
#include "formula/grammar.hxx"
#include "formula/token.hxx"
#include "formula/ExternalReferenceHelper.hxx"
-#include <tools/string.hxx>
#define FORMULA_MAXJUMPCOUNT 32 /* maximum number of jumps (ocChose) */
#define FORMULA_MAXTOKENS 8192 /* maximum number of tokens in formula */
diff --git a/include/svx/gallery.hxx b/include/svx/gallery.hxx
index bae89c2..c26479a 100644
--- a/include/svx/gallery.hxx
+++ b/include/svx/gallery.hxx
@@ -21,7 +21,6 @@
#define _GALLERY_HXX_
#include <tools/solar.h>
-#include <tools/string.hxx>
#include <tools/urlobj.hxx>
#include <vector>
#include "svx/svxdllapi.h"
diff --git a/include/svx/nbdtmg.hxx b/include/svx/nbdtmg.hxx
index 4ce8af4..ab157e2 100644
--- a/include/svx/nbdtmg.hxx
+++ b/include/svx/nbdtmg.hxx
@@ -22,7 +22,6 @@
#include <boost/shared_ptr.hpp>
#include <vector>
#include <editeng/numitem.hxx>
-#include <tools/string.hxx>
#include <vcl/font.hxx>
namespace svx { namespace sidebar {
diff --git a/include/svx/numfmtsh.hxx b/include/svx/numfmtsh.hxx
index 382a466..98fc980 100644
--- a/include/svx/numfmtsh.hxx
+++ b/include/svx/numfmtsh.hxx
@@ -19,7 +19,6 @@
#ifndef _SVX_NUMFMTSH_HXX
#define _SVX_NUMFMTSH_HXX
-#include <tools/string.hxx>
#include <i18nlangtag/lang.h>
#include "svx/svxdllapi.h"
diff --git a/sc/inc/userlist.hxx b/sc/inc/userlist.hxx
index f87f328..23c6819 100644
--- a/sc/inc/userlist.hxx
+++ b/sc/inc/userlist.hxx
@@ -21,7 +21,6 @@
#define SC_USERLIST_HXX
#include <tools/stream.hxx>
-#include <tools/string.hxx>
#include "scdllapi.h"
#include <boost/ptr_container/ptr_vector.hpp>
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index c4fab07..4f465f9 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/sheet/ExternalLinkType.hpp>
#include <comphelper/string.hxx>
#include <sfx2/objsh.hxx>
+#include <tools/string.hxx>
#include <tools/urlobj.hxx>
using namespace ::com::sun::star;
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx
index e04762a..924458a 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -362,13 +362,13 @@ sal_Bool ScAutoFormatDataField::Load( SvStream& rStream, const ScAfVersions& rVe
if( 0 == rVersions.nNumFmtVersion )
{
// --- from 680/dr25 on: store strings as UTF-8
- CharSet eCharSet = (nVer >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
+ rtl_TextEncoding eCharSet = (nVer >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
aNumFormat.Load( rStream, eCharSet );
}
// adjust charset in font
- CharSet eSysSet = osl_getThreadTextEncoding();
- CharSet eSrcSet = rStream.GetStreamCharSet();
+ rtl_TextEncoding eSysSet = osl_getThreadTextEncoding();
+ rtl_TextEncoding eSrcSet = rStream.GetStreamCharSet();
if( eSrcSet != eSysSet && aFont.GetCharSet() == eSrcSet )
aFont.SetCharSet(eSysSet);
diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx
index f5f98c6..5b841e0 100644
--- a/sc/source/filter/ftools/ftools.cxx
+++ b/sc/source/filter/ftools/ftools.cxx
@@ -18,6 +18,7 @@
*/
#include "ftools.hxx"
+#include <osl/thread.h>
#include <rtl/strbuf.hxx>
#include <tools/color.hxx>
#include <unotools/charclass.hxx>
diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx
index 3cb94f9..290f7e5 100644
--- a/sw/source/filter/ascii/parasc.cxx
+++ b/sw/source/filter/ascii/parasc.cxx
@@ -260,7 +260,7 @@ sal_uLong SwASCIIParser::ReadChars()
{
sal_uLong nLen, nOrig;
nOrig = nLen = rInput.Read(pArr, ASC_BUFFLEN);
- CharSet eCharSet;
+ rtl_TextEncoding eCharSet;
bool bRet = SwIoSystem::IsDetectableText(pArr, nLen, &eCharSet, &bSwapUnicode);
OSL_ENSURE(bRet, "Autodetect of text import without nag dialog must "
"have failed");
@@ -276,7 +276,7 @@ sal_uLong SwASCIIParser::ReadChars()
rtl_TextToUnicodeConverter hConverter=0;
rtl_TextToUnicodeContext hContext=0;
- CharSet currentCharSet = pUseMe->GetCharSet();
+ rtl_TextEncoding currentCharSet = pUseMe->GetCharSet();
if (RTL_TEXTENCODING_UCS2 != currentCharSet)
{
if( currentCharSet == RTL_TEXTENCODING_DONTKNOW )
diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx
index d3af051..9dee91c 100644
--- a/sw/source/filter/inc/fltshell.hxx
+++ b/sw/source/filter/inc/fltshell.hxx
@@ -529,7 +529,7 @@ class SwFltShell
//
OUString sBaseURL;
sal_uInt16 nPageDescOffset; // fuers update der pagedescs
- CharSet eSrcCharSet; // charset der quelle
+ rtl_TextEncoding eSrcCharSet; // charset der quelle
friend class SwFltControlStack;
sal_Bool bNewDoc;
sal_Bool bStdPD;
@@ -541,7 +541,7 @@ public:
SwDoc& GetDoc() { return *aStack.pDoc; }
- CharSet SetCharSet(CharSet eNew) { CharSet eOld = eSrcCharSet;
+ rtl_TextEncoding SetCharSet(rtl_TextEncoding eNew) { rtl_TextEncoding eOld = eSrcCharSet;
eSrcCharSet = eNew;
return eOld;
}
commit 91e181ea585855bea97a07823f7334d0b98b20d5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Oct 21 12:23:14 2013 +0100
remove uses of COMPARE_*
Change-Id: Icdc36b4b24d2f399f481065df3200feb98025135
diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx
index f596531..d5d249e 100644
--- a/comphelper/source/misc/string.cxx
+++ b/comphelper/source/misc/string.cxx
@@ -331,7 +331,8 @@ sal_Int32 compareNatural( const OUString & rLHS, const OUString & rRHS,
break;
}
- //Squeeze these down to -1, 0, 1 in case it gets casted to a StringCompare
+ //Squeeze these down to -1, 0, 1 in case there is an assumption those are
+ //the only valid returns
if (nRet > 0)
nRet = 1;
else if (nRet < 0)
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 639d506..0e3de53 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -3402,16 +3402,16 @@ IMPL_LINK( SbaTableQueryBrowser, OnTreeEntryCompare, const SvSortData*, _pSortDa
eLeft = etQueryContainer;
if ( eLeft == eRight )
- return COMPARE_EQUAL;
+ return 0;
if ( ( eLeft == etTableContainer ) && ( eRight == etQueryContainer ) )
- return COMPARE_GREATER;
+ return 1;
if ( ( eLeft == etQueryContainer ) && ( eRight == etTableContainer ) )
- return COMPARE_LESS;
+ return -1;
SAL_WARN("dbaccess.ui", "SbaTableQueryBrowser::OnTreeEntryCompare: unexpected case!" );
- return COMPARE_EQUAL;
+ return 0;
}
const SvLBoxString* pLeftTextItem = static_cast<const SvLBoxString*>(pLHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
diff --git a/include/svtools/simptabl.hxx b/include/svtools/simptabl.hxx
index 1b27463..5b970fe 100644
--- a/include/svtools/simptabl.hxx
+++ b/include/svtools/simptabl.hxx
@@ -83,7 +83,7 @@ protected:
virtual void Command( const CommandEvent& rCEvt );
- virtual StringCompare ColCompare(SvTreeListEntry*,SvTreeListEntry*);
+ virtual sal_Int32 ColCompare(SvTreeListEntry*,SvTreeListEntry*);
public:
SvSimpleTable(SvSimpleTableContainer& rParent, WinBits nBits = WB_BORDER);
diff --git a/include/svtools/treelist.hxx b/include/svtools/treelist.hxx
index 220b2f4..96e50ec 100644
--- a/include/svtools/treelist.hxx
+++ b/include/svtools/treelist.hxx
@@ -26,7 +26,6 @@
#include <tools/solar.h>
#include <tools/link.hxx>
-#include <tools/string.hxx>
#include <tools/debug.hxx>
#include <limits.h>
@@ -223,7 +222,7 @@ public:
void SetSortMode( SvSortMode eMode ) { eSortMode = eMode; }
SvSortMode GetSortMode() const { return eSortMode; }
- StringCompare Compare(const SvTreeListEntry* pLeft, const SvTreeListEntry* pRight) const;
+ sal_Int32 Compare(const SvTreeListEntry* pLeft, const SvTreeListEntry* pRight) const;
void SetCompareHdl( const Link& rLink ) { aCompareLink = rLink; }
const Link& GetCompareHdl() const { return aCompareLink; }
void Resort();
diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx
index f3107d9..b4dfaf0 100644
--- a/include/svx/ctredlin.hxx
+++ b/include/svx/ctredlin.hxx
@@ -105,7 +105,7 @@ private:
protected:
- virtual StringCompare ColCompare(SvTreeListEntry*,SvTreeListEntry*);
+ virtual sal_Int32 ColCompare(SvTreeListEntry*,SvTreeListEntry*);
virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&, SvLBoxButtonKind);
diff --git a/sc/inc/userlist.hxx b/sc/inc/userlist.hxx
index 0cecf31..f87f328 100644
--- a/sc/inc/userlist.hxx
+++ b/sc/inc/userlist.hxx
@@ -55,8 +55,8 @@ public:
size_t GetSubCount() const;
bool GetSubIndex(const OUString& rSubStr, sal_uInt16& rIndex) const;
OUString GetSubStr(sal_uInt16 nIndex) const;
- StringCompare Compare(const OUString& rSubStr1, const OUString& rSubStr2) const;
- StringCompare ICompare(const OUString& rSubStr1, const OUString& rSubStr2) const;
+ sal_Int32 Compare(const OUString& rSubStr1, const OUString& rSubStr2) const;
+ sal_Int32 ICompare(const OUString& rSubStr1, const OUString& rSubStr2) const;
};
/**
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 3ab133c..117f2a0 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1148,8 +1148,7 @@ bool ScConditionEntry::IsValidStr( const OUString& rArg, const ScAddress& rPos )
OUString aUpVal2( aStrVal2 );
if ( eOp == SC_COND_BETWEEN || eOp == SC_COND_NOTBETWEEN )
- if ( ScGlobal::GetCollator()->compareString( aUpVal1, aUpVal2 )
- == COMPARE_GREATER )
+ if (ScGlobal::GetCollator()->compareString( aUpVal1, aUpVal2 ) > 0)
{
// richtige Reihenfolge fuer Wertebereich
OUString aTemp( aUpVal1 ); aUpVal1 = aUpVal2; aUpVal2 = aTemp;
@@ -1159,11 +1158,11 @@ bool ScConditionEntry::IsValidStr( const OUString& rArg, const ScAddress& rPos )
{
case SC_COND_EQUAL:
bValid = (ScGlobal::GetCollator()->compareString(
- rArg, aUpVal1 ) == COMPARE_EQUAL);
+ rArg, aUpVal1 ) == 0);
break;
case SC_COND_NOTEQUAL:
bValid = (ScGlobal::GetCollator()->compareString(
- rArg, aUpVal1 ) != COMPARE_EQUAL);
+ rArg, aUpVal1 ) != 0);
break;
case SC_COND_TOP_PERCENT:
case SC_COND_BOTTOM_PERCENT:
@@ -1197,23 +1196,23 @@ bool ScConditionEntry::IsValidStr( const OUString& rArg, const ScAddress& rPos )
switch ( eOp )
{
case SC_COND_GREATER:
- bValid = ( nCompare == COMPARE_GREATER );
+ bValid = ( nCompare > 0 );
break;
case SC_COND_EQGREATER:
- bValid = ( nCompare == COMPARE_EQUAL || nCompare == COMPARE_GREATER );
+ bValid = ( nCompare >= 0 );
break;
case SC_COND_LESS:
- bValid = ( nCompare == COMPARE_LESS );
+ bValid = ( nCompare < 0 );
break;
case SC_COND_EQLESS:
- bValid = ( nCompare == COMPARE_EQUAL || nCompare == COMPARE_LESS );
+ bValid = ( nCompare <= 0 );
break;
case SC_COND_BETWEEN:
case SC_COND_NOTBETWEEN:
// Test auf NOTBETWEEN:
- bValid = ( nCompare == COMPARE_LESS ||
+ bValid = ( nCompare < 0 ||
ScGlobal::GetCollator()->compareString( rArg,
- aUpVal2 ) == COMPARE_GREATER );
+ aUpVal2 ) > 0 );
if ( eOp == SC_COND_BETWEEN )
bValid = !bValid;
break;
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx
index 0874b0a..21bb859 100644
--- a/sc/source/core/data/funcdesc.cxx
+++ b/sc/source/core/data/funcdesc.cxx
@@ -394,7 +394,7 @@ bool ScFuncDesc::isParameterOptional(sal_uInt32 _nPos) const
bool ScFuncDesc::compareByName(const ScFuncDesc* a, const ScFuncDesc* b)
{
- return (ScGlobal::GetCaseCollator()->compareString(*a->pFuncName, *b->pFuncName ) == COMPARE_LESS);
+ return (ScGlobal::GetCaseCollator()->compareString(*a->pFuncName, *b->pFuncName ) < 0);
}
//===================================================================
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index ee48e0f..076b302 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -1393,66 +1393,68 @@ int SAL_CALL ScRangePairList_QsortNameCompare( const void* p1, const void* p2 )
OUString aStr1, aStr2;
sal_Int32 nComp;
if ( rStartPos1.Tab() == rStartPos2.Tab() )
- nComp = COMPARE_EQUAL;
+ nComp = 0;
else
{
ps1->pDoc->GetName( rStartPos1.Tab(), aStr1 );
ps2->pDoc->GetName( rStartPos2.Tab(), aStr2 );
nComp = ScGlobal::GetCollator()->compareString( aStr1, aStr2 );
}
- switch ( nComp )
+ if (nComp < 0)
{
- case COMPARE_LESS:
+ return -1;
+ }
+ else if (nComp > 0)
+ {
+ return 1;
+ }
+ else
+ {
+ // gleiche Tabs
+ if ( rStartPos1.Col() < rStartPos2.Col() )
return -1;
- //break;
- case COMPARE_GREATER:
+ if ( rStartPos1.Col() > rStartPos2.Col() )
return 1;
- //break;
- default:
- // gleiche Tabs
- if ( rStartPos1.Col() < rStartPos2.Col() )
- return -1;
- if ( rStartPos1.Col() > rStartPos2.Col() )
- return 1;
- // gleiche Cols
- if ( rStartPos1.Row() < rStartPos2.Row() )
+ // gleiche Cols
+ if ( rStartPos1.Row() < rStartPos2.Row() )
+ return -1;
+ if ( rStartPos1.Row() > rStartPos2.Row() )
+ return 1;
+ // erste Ecke gleich, zweite Ecke
+ {
+ const ScAddress& rEndPos1 = ps1->pPair->GetRange(0).aEnd;
+ const ScAddress& rEndPos2 = ps2->pPair->GetRange(0).aEnd;
+ if ( rEndPos1.Tab() == rEndPos2.Tab() )
+ nComp = 0;
+ else
+ {
+ ps1->pDoc->GetName( rEndPos1.Tab(), aStr1 );
+ ps2->pDoc->GetName( rEndPos2.Tab(), aStr2 );
+ nComp = ScGlobal::GetCollator()->compareString( aStr1, aStr2 );
+ }
+ if (nComp < 0)
+ {
return -1;
- if ( rStartPos1.Row() > rStartPos2.Row() )
+ }
+ else if (nComp > 0)
+ {
return 1;
- // erste Ecke gleich, zweite Ecke
+ }
+ else
{
- const ScAddress& rEndPos1 = ps1->pPair->GetRange(0).aEnd;
- const ScAddress& rEndPos2 = ps2->pPair->GetRange(0).aEnd;
- if ( rEndPos1.Tab() == rEndPos2.Tab() )
- nComp = COMPARE_EQUAL;
- else
- {
- ps1->pDoc->GetName( rEndPos1.Tab(), aStr1 );
- ps2->pDoc->GetName( rEndPos2.Tab(), aStr2 );
- nComp = ScGlobal::GetCollator()->compareString( aStr1, aStr2 );
- }
- switch ( nComp )
- {
- case COMPARE_LESS:
- return -1;
- //break;
- case COMPARE_GREATER:
- return 1;
- //break;
- default:
- // gleiche Tabs
- if ( rEndPos1.Col() < rEndPos2.Col() )
- return -1;
- if ( rEndPos1.Col() > rEndPos2.Col() )
- return 1;
- // gleiche Cols
- if ( rEndPos1.Row() < rEndPos2.Row() )
- return -1;
- if ( rEndPos1.Row() > rEndPos2.Row() )
- return 1;
- return 0;
- }
+ // gleiche Tabs
+ if ( rEndPos1.Col() < rEndPos2.Col() )
+ return -1;
+ if ( rEndPos1.Col() > rEndPos2.Col() )
+ return 1;
+ // gleiche Cols
+ if ( rEndPos1.Row() < rEndPos2.Row() )
+ return -1;
+ if ( rEndPos1.Row() > rEndPos2.Row() )
+ return 1;
+ return 0;
}
+ }
}
#ifndef _MSC_VER // MSVC is good enough to warn about unreachable code here.
// Or stupid enough to bother warning about it, depending
diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx
index 4d5ed08..a379e22 100644
--- a/sc/source/core/tool/userlist.cxx
+++ b/sc/source/core/tool/userlist.cxx
@@ -143,7 +143,7 @@ OUString ScUserListData::GetSubStr(sal_uInt16 nIndex) const
return OUString();
}
-StringCompare ScUserListData::Compare(const OUString& rSubStr1, const OUString& rSubStr2) const
+sal_Int32 ScUserListData::Compare(const OUString& rSubStr1, const OUString& rSubStr2) const
{
sal_uInt16 nIndex1, nIndex2;
bool bFound1 = GetSubIndex(rSubStr1, nIndex1);
@@ -153,22 +153,22 @@ StringCompare ScUserListData::Compare(const OUString& rSubStr1, const OUString&
if (bFound2)
{
if (nIndex1 < nIndex2)
- return COMPARE_LESS;
+ return -1;
else if (nIndex1 > nIndex2)
- return COMPARE_GREATER;
+ return 1;
else
- return COMPARE_EQUAL;
+ return 0;
}
else
- return COMPARE_LESS;
+ return -1;
}
else if (bFound2)
- return COMPARE_GREATER;
+ return 1;
else
- return (StringCompare) ScGlobal::GetCaseTransliteration()->compareString( rSubStr1, rSubStr2 );
+ return ScGlobal::GetCaseTransliteration()->compareString( rSubStr1, rSubStr2 );
}
-StringCompare ScUserListData::ICompare(const OUString& rSubStr1, const OUString& rSubStr2) const
+sal_Int32 ScUserListData::ICompare(const OUString& rSubStr1, const OUString& rSubStr2) const
{
sal_uInt16 nIndex1, nIndex2;
bool bFound1 = GetSubIndex(rSubStr1, nIndex1);
@@ -178,19 +178,19 @@ StringCompare ScUserListData::ICompare(const OUString& rSubStr1, const OUString&
if (bFound2)
{
if (nIndex1 < nIndex2)
- return COMPARE_LESS;
+ return -1;
else if (nIndex1 > nIndex2)
- return COMPARE_GREATER;
+ return 1;
else
- return COMPARE_EQUAL;
+ return 0;
}
else
- return COMPARE_LESS;
+ return -1;
}
else if (bFound2)
- return COMPARE_GREATER;
+ return 1;
else
- return (StringCompare) ScGlobal::GetpTransliteration()->compareString( rSubStr1, rSubStr2 );
+ return ScGlobal::GetpTransliteration()->compareString( rSubStr1, rSubStr2 );
}
ScUserList::ScUserList()
diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx
index 2951550..e08b692 100644
--- a/sc/source/filter/excel/xelink.cxx
+++ b/sc/source/filter/excel/xelink.cxx
@@ -839,7 +839,7 @@ typedef ::std::vector< XclExpTabName > XclExpTabNameVec;
inline bool operator<( const XclExpTabName& rArg1, const XclExpTabName& rArg2 )
{
// compare the sheet names only
- return ScGlobal::GetCollator()->compareString( rArg1.first, rArg2.first ) == COMPARE_LESS;
+ return ScGlobal::GetCollator()->compareString( rArg1.first, rArg2.first ) < 0;
}
void XclExpTabInfo::CalcSortedIndexes()
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index f837b42..3f077d8 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -1881,7 +1881,7 @@ IMPL_LINK_NOARG(ScAcceptChgDlg, FilterModified)
IMPL_LINK( ScAcceptChgDlg, ColCompareHdl, SvSortData*, pSortData )
{
- StringCompare eCompare=COMPARE_EQUAL;
+ sal_Int32 nCompare = 0;
SCCOL nSortCol= static_cast<SCCOL>(pTheView->GetSortedCol());
if(pSortData)
@@ -1897,11 +1897,10 @@ IMPL_LINK( ScAcceptChgDlg, ColCompareHdl, SvSortData*, pSortData )
if(pLeftData!=NULL && pRightData!=NULL)
{
if(pLeftData->aDateTime < pRightData->aDateTime)
- eCompare=COMPARE_LESS;
+ nCompare = -1;
else if(pLeftData->aDateTime > pRightData->aDateTime)
- eCompare=COMPARE_GREATER;
-
- return eCompare;
+ nCompare = 1;
+ return nCompare;
}
}
else if(CALC_POS==nSortCol)
@@ -1911,24 +1910,24 @@ IMPL_LINK( ScAcceptChgDlg, ColCompareHdl, SvSortData*, pSortData )
if(pLeftData!=NULL && pRightData!=NULL)
{
- eCompare=COMPARE_GREATER;
+ nCompare = 1;
if(pLeftData->nTable < pRightData->nTable)
- eCompare=COMPARE_LESS;
+ nCompare = -1;
else if(pLeftData->nTable == pRightData->nTable)
{
if(pLeftData->nRow < pRightData->nRow)
- eCompare=COMPARE_LESS;
+ nCompare = -1;
else if(pLeftData->nRow == pRightData->nRow)
{
if(pLeftData->nCol < pRightData->nCol)
- eCompare=COMPARE_LESS;
+ nCompare = -1;
else if(pLeftData->nCol == pRightData->nCol)
- eCompare=COMPARE_EQUAL;
+ nCompare = 0;
}
}
- return eCompare;
+ return nCompare;
}
}
@@ -1943,17 +1942,18 @@ IMPL_LINK( ScAcceptChgDlg, ColCompareHdl, SvSortData*, pSortData )
if(nRightKind == SV_ITEM_ID_LBOXSTRING &&
nLeftKind == SV_ITEM_ID_LBOXSTRING )
{
- eCompare= (StringCompare) ScGlobal::GetCaseCollator()->compareString(
+ nCompare = ScGlobal::GetCaseCollator()->compareString(
((SvLBoxString*)pLeftItem)->GetText(),
((SvLBoxString*)pRightItem)->GetText());
- if(eCompare==COMPARE_EQUAL) eCompare=COMPARE_LESS;
+ if (nCompare == 0)
+ nCompare = -1;
}
}
}
- return eCompare;
+ return nCompare;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index b2783de..6488c7b 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -51,7 +51,7 @@ struct ScSolverOptionsEntry
bool operator< (const ScSolverOptionsEntry& rOther) const
{
- return ( ScGlobal::GetCollator()->compareString( aDescription, rOther.aDescription ) == COMPARE_LESS );
+ return (ScGlobal::GetCollator()->compareString( aDescription, rOther.aDescription ) < 0);
}
};
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index 13f50b1..86a1888 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -979,7 +979,7 @@ OUString ViewShellBase::GetInitialViewShellType (void)
for (sal_Int32 n=0; n<aProperties.getLength(); n++)
{
const beans::PropertyValue& rProperty (aProperties[n]);
- if (rProperty.Name.compareToAscii(sUNO_View_PageKind) == COMPARE_EQUAL)
+ if (rProperty.Name == sUNO_View_PageKind)
{
sal_Int16 nPageKind = 0;
rProperty.Value >>= nPageKind;
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 2f25eec..f8fa84a 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -2053,14 +2053,13 @@ Reference < XDispatch > SAL_CALL SfxAppDispatchProvider::queryDispatch(
Reference < XDispatch > xDisp;
const SfxSlot* pSlot = 0;
SfxDispatcher* pAppDisp = SFX_APP()->GetAppDispatcher_Impl();
- if ( aURL.Protocol.compareToAscii( "slot:" ) == COMPARE_EQUAL ||
- aURL.Protocol.compareToAscii( "commandId:" ) == COMPARE_EQUAL )
+ if ( aURL.Protocol == "slot:" || aURL.Protocol == "commandId:" )
{
nId = (sal_uInt16) aURL.Path.toInt32();
SfxShell* pShell;
pAppDisp->GetShellAndSlot_Impl( nId, &pShell, &pSlot, sal_True, sal_True );
}
- else if ( aURL.Protocol.compareToAscii( ".uno:" ) == COMPARE_EQUAL )
+ else if ( aURL.Protocol == ".uno:" )
{
// Support ".uno" commands. Map commands to slotid
bMasterCommand = SfxOfficeDispatch::IsMasterUnoCommand( aURL );
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index d0948c1..bafa7c2 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -344,7 +344,7 @@ void ShutdownIcon::FromTemplate()
Reference < ::com::sun::star::frame::XDispatch > xDisp;
if ( xProv.is() )
{
- if ( aTargetURL.Protocol.compareToAscii("slot:") == COMPARE_EQUAL )
+ if (aTargetURL.Protocol == "slot:")
xDisp = xProv->queryDispatch( aTargetURL, OUString(), 0 );
else
xDisp = xProv->queryDispatch( aTargetURL, OUString("_blank"), 0 );
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 3d067e2..0c0869c 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -635,8 +635,8 @@ sal_Bool StyleTreeListBox_Impl::NotifyMoving(SvTreeListEntry* pTarget,
IntlWrapper aIntlWrapper( Application::GetSettings().GetLanguageTag() );
const CollatorWrapper* pCollator = aIntlWrapper.getCaseCollator();
for(SvTreeListEntry *pTmpEntry=FirstChild(pTarget);
- pTmpEntry && COMPARE_LESS==pCollator->compareString(
- GetEntryText(pTmpEntry),GetEntryText(pEntry));
+ pTmpEntry && pCollator->compareString(
+ GetEntryText(pTmpEntry),GetEntryText(pEntry)) < 0;
pTmpEntry=NextSibling(pTmpEntry),lPos++) ;
return bRet? (sal_Bool)2: sal_False;
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index b426eb8..165c680 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2183,7 +2183,7 @@ sal_Bool SfxObjectShell::ImportFrom( SfxMedium& rMedium, bool bInsert )
for ( sal_Int32 nFilterProp = 0; nFilterProp<nFilterProps; nFilterProp++ )
{
const beans::PropertyValue& rFilterProp = aProps[nFilterProp];
- if ( rFilterProp.Name.compareToAscii("FilterService") == COMPARE_EQUAL )
+ if (rFilterProp.Name == "FilterService")
{
rFilterProp.Value >>= aFilterImplName;
break;
@@ -2312,7 +2312,7 @@ sal_Bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
for ( sal_Int32 nFilterProp = 0; nFilterProp<nFilterProps; nFilterProp++ )
{
const beans::PropertyValue& rFilterProp = aProps[nFilterProp];
- if ( rFilterProp.Name.compareToAscii("FilterService") == COMPARE_EQUAL )
+ if (rFilterProp.Name == "FilterService")
{
rFilterProp.Value >>= aFilterImplName;
break;
@@ -3313,7 +3313,7 @@ sal_Bool StoragesOfUnknownMediaTypeAreCopied_Impl( const uno::Reference< embed::
// TODO/LATER: there should be a way to detect whether an object with such a MediaType can exist
// probably it should be placed in the MimeType-ClassID table or in standalone table
if ( !aMediaType.isEmpty()
- && aMediaType.compareToAscii( "application/vnd.sun.star.oleobject" ) != COMPARE_EQUAL )
+ && aMediaType != "application/vnd.sun.star.oleobject" )
{
::com::sun::star::datatransfer::DataFlavor aDataFlavor;
aDataFlavor.MimeType = aMediaType;
@@ -3455,7 +3455,7 @@ sal_Bool SfxObjectShell::CopyStoragesOfUnknownMediaType( const uno::Reference< e
// TODO/LATER: there should be a way to detect whether an object with such a MediaType can exist
// probably it should be placed in the MimeType-ClassID table or in standalone table
if ( !aMediaType.isEmpty()
- && aMediaType.compareToAscii( "application/vnd.sun.star.oleobject" ) != COMPARE_EQUAL )
+ && aMediaType != "application/vnd.sun.star.oleobject" )
{
::com::sun::star::datatransfer::DataFlavor aDataFlavor;
aDataFlavor.MimeType = aMediaType;
diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx
index 5b3f084..962a67a 100644
--- a/sfx2/source/menu/mnuitem.cxx
+++ b/sfx2/source/menu/mnuitem.cxx
@@ -427,7 +427,7 @@ long Select_Impl( void* /*pHdl*/, void* pVoid )
xTrans->parseStrict( aTargetURL );
Reference < XDispatch > xDisp;
- if ( aTargetURL.Protocol.compareToAscii("slot:") == COMPARE_EQUAL )
+ if (aTargetURL.Protocol == "slot:")
xDisp = xDesktop->queryDispatch( aTargetURL, OUString(), 0 );
else
{
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index a03c882..929343a 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -1874,7 +1874,7 @@ void SvtFileView_Impl::FilterFolderContent_Impl( const OUString &rFilter )
}
if ( !bHideTransFile &&
- ( rFilter.isEmpty() || ( rFilter.compareToAscii( ALL_FILES_FILTER ) == COMPARE_EQUAL ) ) )
+ ( rFilter.isEmpty() || ( rFilter == ALL_FILES_FILTER ) ) )
// when replacing names, there is always something to filter (no view of ".nametranslation.table")
return;
diff --git a/svtools/source/contnr/simptabl.cxx b/svtools/source/contnr/simptabl.cxx
index 8070d9c..4beba6c 100644
--- a/svtools/source/contnr/simptabl.cxx
+++ b/svtools/source/contnr/simptabl.cxx
@@ -445,9 +445,9 @@ SvLBoxItem* SvSimpleTable::GetEntryAtPos( SvTreeListEntry* pEntry, sal_uInt16 nP
return pItem;
}
-StringCompare SvSimpleTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry* pRight)
+sal_Int32 SvSimpleTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry* pRight)
{
- StringCompare eCompare=COMPARE_EQUAL;
+ sal_Int32 nCompare = 0;
SvLBoxItem* pLeftItem = GetEntryAtPos( pLeft, nSortCol);
SvLBoxItem* pRightItem = GetEntryAtPos( pRight, nSortCol);
@@ -464,13 +464,14 @@ StringCompare SvSimpleTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry*
IntlWrapper aIntlWrapper( Application::GetSettings().GetLanguageTag() );
const CollatorWrapper* pCollator = aIntlWrapper.getCaseCollator();
- eCompare=(StringCompare)pCollator->compareString( ((SvLBoxString*)pLeftItem)->GetText(),
+ nCompare = pCollator->compareString( ((SvLBoxString*)pLeftItem)->GetText(),
((SvLBoxString*)pRightItem)->GetText());
- if(eCompare==COMPARE_EQUAL) eCompare=COMPARE_LESS;
+ if (nCompare == 0)
+ nCompare = -1;
}
}
- return eCompare;
+ return nCompare;
}
IMPL_LINK( SvSimpleTable, CompareHdl, SvSortData*, pData)
diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx
index 55beae9..8500425 100644
--- a/svtools/source/contnr/treelist.cxx
+++ b/svtools/source/contnr/treelist.cxx
@@ -1498,16 +1498,16 @@ SvViewDataEntry* SvListView::GetViewData( SvTreeListEntry* pEntry )
return itr->second;
}
-StringCompare SvTreeList::Compare(const SvTreeListEntry* pLeft, const SvTreeListEntry* pRight) const
+sal_Int32 SvTreeList::Compare(const SvTreeListEntry* pLeft, const SvTreeListEntry* pRight) const
{
if( aCompareLink.IsSet())
{
SvSortData aSortData;
aSortData.pLeft = pLeft;
aSortData.pRight = pRight;
- return (StringCompare)aCompareLink.Call( &aSortData );
+ return aCompareLink.Call( &aSortData );
}
- return COMPARE_EQUAL;
+ return 0;
}
void SvTreeList::Resort()
@@ -1576,27 +1576,27 @@ void SvTreeList::GetInsertionPos( SvTreeListEntry* pEntry, SvTreeListEntry* pPar
long i = 0;
long j = rChildList.size()-1;
long k;
- StringCompare eCompare = COMPARE_GREATER;
+ sal_Int32 nCompare = 1;
do
{
k = (i+j)/2;
const SvTreeListEntry* pTempEntry = &rChildList[k];
- eCompare = Compare( pEntry, pTempEntry );
- if( eSortMode == SortDescending && eCompare != COMPARE_EQUAL )
+ nCompare = Compare( pEntry, pTempEntry );
+ if( eSortMode == SortDescending && nCompare != 0 )
{
- if( eCompare == COMPARE_LESS )
- eCompare = COMPARE_GREATER;
+ if( nCompare < 0 )
+ nCompare = 1;
else
- eCompare = COMPARE_LESS;
+ nCompare = -1;
}
- if( eCompare == COMPARE_GREATER )
+ if( nCompare > 0 )
i = k + 1;
else
j = k - 1;
- } while( (eCompare != COMPARE_EQUAL) && (i <= j) );
+ } while( (nCompare != 0) && (i <= j) );
- if( eCompare != COMPARE_EQUAL )
+ if( nCompare != 0 )
{
if (i > static_cast<long>(rChildList.size()-1)) // not found, end of list
rPos = ULONG_MAX;
diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx
index af0f2f9..4f8fc91 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -128,18 +128,18 @@ static sal_Int32 ImplCompareFontInfo( ImplFontListFontInfo* pInfo1,
{
//Sort non italic before italics
if ( pInfo1->GetItalic() < pInfo2->GetItalic() )
- return COMPARE_LESS;
+ return -1;
else if ( pInfo1->GetItalic() > pInfo2->GetItalic() )
- return COMPARE_GREATER;
+ return 1;
//Sort normal weight to the start, followed by lightest to heaviest weights
int nWeight1 = sortWeightValue(pInfo1->GetWeight());
int nWeight2 = sortWeightValue(pInfo2->GetWeight());
if ( nWeight1 < nWeight2 )
- return COMPARE_LESS;
+ return -1;
else if ( nWeight1 > nWeight2 )
- return COMPARE_GREATER;
+ return 1;
return pInfo1->GetStyleName().compareTo( pInfo2->GetStyleName() );
}
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index 16594c1..ea051c7 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -366,15 +366,15 @@ uno::Reference< beans::XPropertySet > SAL_CALL GraphicProvider::queryGraphicDesc
const OUString aName( rMediaProperties[ i ].Name );
const uno::Any aValue( rMediaProperties[ i ].Value );
- if( COMPARE_EQUAL == aName.compareToAscii( "URL" ) )
+ if (aName == "URL")
{
aValue >>= aURL;
}
- else if( COMPARE_EQUAL == aName.compareToAscii( "InputStream" ) )
+ else if (aName == "InputStream")
{
aValue >>= xIStm;
}
- else if( COMPARE_EQUAL == aName.compareToAscii( "Bitmap" ) )
+ else if (aName == "Bitmap")
{
aValue >>= xBtm;
}
@@ -442,21 +442,21 @@ uno::Reference< ::graphic::XGraphic > SAL_CALL GraphicProvider::queryGraphic( co
const OUString aName( rMediaProperties[ i ].Name );
const uno::Any aValue( rMediaProperties[ i ].Value );
- if( COMPARE_EQUAL == aName.compareToAscii( "URL" ) )
+ if (aName == "URL")
{
OUString aURL;
aValue >>= aURL;
aPath = aURL;
}
- else if( COMPARE_EQUAL == aName.compareToAscii( "InputStream" ) )
+ else if (aName == "InputStream")
{
aValue >>= xIStm;
}
- else if( COMPARE_EQUAL == aName.compareToAscii( "Bitmap" ) )
+ else if (aName == "Bitmap")
{
aValue >>= xBtm;
}
- else if( COMPARE_EQUAL == aName.compareToAscii( "FilterData" ) )
+ else if (aName == "FilterData")
{
aValue >>= aFilterData;
}
@@ -471,15 +471,15 @@ uno::Reference< ::graphic::XGraphic > SAL_CALL GraphicProvider::queryGraphic( co
const OUString aName( aFilterData[ i ].Name );
const uno::Any aValue( aFilterData[ i ].Value );
- if( COMPARE_EQUAL == aName.compareToAscii( "ExternalWidth" ) )
+ if (aName == "ExternalWidth")
{
aValue >>= nExtWidth;
}
- else if( COMPARE_EQUAL == aName.compareToAscii( "ExternalHeight" ) )
+ else if (aName == "ExternalHeight")
{
aValue >>= nExtHeight;
}
- else if( COMPARE_EQUAL == aName.compareToAscii( "ExternalMapMode" ) )
+ else if (aName == "ExternalMapMode")
{
aValue >>= nExtMapMode;
}
@@ -646,17 +646,17 @@ void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyVal
const OUString aName( rFilterData[ i ].Name );
const uno::Any aValue( rFilterData[ i ].Value );
- if( COMPARE_EQUAL == aName.compareToAscii( "PixelWidth" ) )
+ if (aName == "PixelWidth")
aValue >>= nPixelWidth;
- else if( COMPARE_EQUAL == aName.compareToAscii( "PixelHeight" ) )
+ else if (aName == "PixelHeight")
aValue >>= nPixelHeight;
- else if( COMPARE_EQUAL == aName.compareToAscii( "LogicalSize" ) )
+ else if (aName == "LogicalSize")
aValue >>= aLogicalSize;
- else if (COMPARE_EQUAL == aName.compareToAscii( "GraphicCropLogic" ) )
+ else if (aName == "GraphicCropLogic")
aValue >>= aCropLogic;
- else if (COMPARE_EQUAL == aName.compareToAscii( "RemoveCropArea" ) )
+ else if (aName == "RemoveCropArea")
aValue >>= bRemoveCropArea;
- else if (COMPARE_EQUAL == aName.compareToAscii( "ImageResolution" ) )
+ else if (aName == "ImageResolution")
aValue >>= nImageResolution;
}
if ( rGraphic.GetType() == GRAPHIC_BITMAP )
@@ -784,7 +784,7 @@ void SAL_CALL GraphicProvider::storeGraphic( const uno::Reference< ::graphic::XG
const OUString aName( rMediaProperties[ i ].Name );
const uno::Any aValue( rMediaProperties[ i ].Value );
- if( COMPARE_EQUAL == aName.compareToAscii( "URL" ) )
+ if (aName == "URL")
{
OUString aURL;
@@ -792,7 +792,7 @@ void SAL_CALL GraphicProvider::storeGraphic( const uno::Reference< ::graphic::XG
pOStm = ::utl::UcbStreamHelper::CreateStream( aURL, STREAM_WRITE | STREAM_TRUNC );
aPath = aURL;
}
- else if( COMPARE_EQUAL == aName.compareToAscii( "OutputStream" ) )
+ else if (aName == "OutputStream")
{
uno::Reference< io::XStream > xOStm;
@@ -813,51 +813,51 @@ void SAL_CALL GraphicProvider::storeGraphic( const uno::Reference< ::graphic::XG
const OUString aName( rMediaProperties[ i ].Name );
const uno::Any aValue( rMediaProperties[ i ].Value );
- if( COMPARE_EQUAL == aName.compareToAscii( "FilterData" ) )
+ if (aName == "FilterData")
{
aValue >>= aFilterDataSeq;
}
- else if( COMPARE_EQUAL == aName.compareToAscii( "MimeType" ) )
+ else if (aName == "MimeType")
{
OUString aMimeType;
aValue >>= aMimeType;
- if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_BMP ) )
+ if (aMimeType == MIMETYPE_BMP)
pFilterShortName = "bmp";
- else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_EPS ) )
+ else if (aMimeType == MIMETYPE_EPS)
pFilterShortName = "eps";
- else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_GIF ) )
+ else if (aMimeType == MIMETYPE_GIF)
pFilterShortName = "gif";
- else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_JPG ) )
+ else if (aMimeType == MIMETYPE_JPG)
pFilterShortName = "jpg";
- else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_MET ) )
+ else if (aMimeType == MIMETYPE_MET)
pFilterShortName = "met";
- else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_PNG ) )
+ else if (aMimeType == MIMETYPE_PNG)
pFilterShortName = "png";
- else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_PCT ) )
+ else if (aMimeType == MIMETYPE_PCT)
pFilterShortName = "pct";
- else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_PBM ) )
+ else if (aMimeType == MIMETYPE_PBM)
pFilterShortName = "pbm";
- else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_PGM ) )
+ else if (aMimeType == MIMETYPE_PGM)
pFilterShortName = "pgm";
- else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_PPM ) )
+ else if (aMimeType == MIMETYPE_PPM)
pFilterShortName = "ppm";
- else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_RAS ) )
+ else if (aMimeType == MIMETYPE_RAS)
pFilterShortName = "ras";
- else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_SVM ) )
+ else if (aMimeType == MIMETYPE_SVM)
pFilterShortName = "svm";
- else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_TIF ) )
+ else if (aMimeType == MIMETYPE_TIF)
pFilterShortName = "tif";
- else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_EMF ) )
+ else if (aMimeType == MIMETYPE_EMF)
pFilterShortName = "emf";
- else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_WMF ) )
+ else if (aMimeType == MIMETYPE_WMF)
pFilterShortName = "wmf";
- else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_XPM ) )
+ else if (aMimeType == MIMETYPE_XPM)
pFilterShortName = "xpm";
- else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_SVG ) )
+ else if (aMimeType == MIMETYPE_SVG)
pFilterShortName = "svg";
- else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_VCLGRAPHIC ) )
+ else if (aMimeType == MIMETYPE_VCLGRAPHIC)
pFilterShortName = MIMETYPE_VCLGRAPHIC;
}
}
diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx
index b9f78c1..781980d 100644
--- a/svtools/source/misc/imagemgr.cxx
+++ b/svtools/source/misc/imagemgr.cxx
@@ -236,7 +236,7 @@ static OUString GetImageExtensionByFactory_Impl( const OUString& rURL )
for ( sal_Int32 i = 0; i < nProps; ++i )
{
const ::com::sun::star::beans::PropertyValue& rProp = aTypeProps[i];
- if ( rProp.Name.compareToAscii("Extensions") == COMPARE_EQUAL )
+ if (rProp.Name == "Extensions")
{
::com::sun::star::uno::Sequence < OUString > aExtensions;
if ( ( rProp.Value >>= aExtensions ) && aExtensions.getLength() > 0 )
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 082421e..254dad6 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -148,16 +148,16 @@ SvxRedlinTable::~SvxRedlinTable()
delete pCommentSearcher;
}
-StringCompare SvxRedlinTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry* pRight)
+sal_Int32 SvxRedlinTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry* pRight)
{
- StringCompare eCompare=COMPARE_EQUAL;
+ sal_Int32 nCompare = 0;
if(aColCompareLink.IsSet())
{
SvSortData aRedlinCompare;
aRedlinCompare.pLeft=pLeft;
aRedlinCompare.pRight=pRight;
- eCompare=(StringCompare) aColCompareLink.Call(&aRedlinCompare);
+ nCompare = aColCompareLink.Call(&aRedlinCompare);
}
else
{
@@ -170,24 +170,24 @@ StringCompare SvxRedlinTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry*
{
if(pLeftData->aDateTime < pRightData->aDateTime)
{
- eCompare=COMPARE_LESS;
+ nCompare = -1;
}
else if(pLeftData->aDateTime > pRightData->aDateTime)
{
- eCompare=COMPARE_GREATER;
+ nCompare = 1;
}
}
else
- eCompare=SvSimpleTable::ColCompare(pLeft,pRight);
+ nCompare = SvSimpleTable::ColCompare(pLeft,pRight);
}
else
{
- eCompare=SvSimpleTable::ColCompare(pLeft,pRight);
+ nCompare = SvSimpleTable::ColCompare(pLeft,pRight);
}
}
- return eCompare;
+ return nCompare;
}
void SvxRedlinTable::SetCalcView(sal_Bool bFlag)
{
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 52a531c..2a1cd95 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -425,7 +425,7 @@ namespace
const OUString* pMethodsNames = aMethodsNames.getConstArray();
for (k=0; k<aMethodsNames.getLength(); ++k, ++pMethodsNames)
{
- if ((*pMethodsNames).compareTo(pCurrent->EventMethod) != COMPARE_EQUAL)
+ if ((*pMethodsNames) != pCurrent->EventMethod)
// the current ScriptEventDescriptor doesn't match the current listeners current method
continue;
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index 54af4a1..da61e05 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -370,7 +370,7 @@ sal_uInt16 BulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLe
{
if ( (cChar == pActualBullets[i]->cBulletChar||
(cChar == 9830 && 57356 == pActualBullets[i]->cBulletChar) ||
- (cChar == 9632 && 57354 == pActualBullets[i]->cBulletChar)))// && pFont && (pFont->GetName().CompareTo(pActualBullets[i]->aFont.GetName())==COMPARE_EQUAL))
+ (cChar == 9632 && 57354 == pActualBullets[i]->cBulletChar)))
{
return i+1;
}
@@ -638,13 +638,12 @@ sal_uInt16 GraphyicBulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uI
if ( pGrf )
{
- //const String* pGrfName = pBrsh->GetGraphicLink();
Graphic aGraphic;
for (sal_uInt16 i=0; i < aGrfDataLst.size(); ++i)
{
GrfBulDataRelation* pEntry = aGrfDataLst[i];
sal_Bool bExist = sal_False;
- if ( pEntry) // && pEntry->sGrfName.CompareTo(*pGrfName)==COMPARE_EQUAL )
+ if ( pEntry)
bExist = GalleryExplorer::GetGraphicObj(GALLERY_THEME_BULLETS, pEntry->nGallaryIndex,&aGraphic);
if (bExist) {
Bitmap aSum=pGrf->GetBitmap();
@@ -988,7 +987,6 @@ sal_uInt16 MixBulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16
if ( (cChar == ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->cBulletChar||
(cChar == 9830 && 57356 == ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->cBulletChar) ||
(cChar == 9632 && 57354 == ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->cBulletChar)))//&&
- //(pFont && pFont->GetName().CompareTo(((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->aFont.GetName())==COMPARE_EQUAL) )
{
return pActualBullets[i]->nIndex;
}
@@ -1016,8 +1014,7 @@ sal_uInt16 MixBulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16
{
return pActualBullets[i]->nIndex;
}
- }else { //if ( pEntry && pGrfName && pEntry->sGrfName.CompareTo(*pGrfName)==COMPARE_EQUAL )
- //bExist = GalleryExplorer::GetGraphicObj(GALLERY_THEME_BULLETS, pActualBullets[i]->nIndexDefault-1,pSrGrf);
+ }else {
Graphic aSrGrf;
if (pEntry)
GalleryExplorer::GetGraphicObj(GALLERY_THEME_BULLETS, pActualBullets[i]->nIndexDefault,&aSrGrf);
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
index 301acda..5f2d138 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
@@ -372,9 +372,9 @@ IMPL_LINK( DictionaryList, CompareHdl, SvSortData*, pData )
return (long) ColumnCompare(pLeft,pRight);
}
-StringCompare DictionaryList::ColumnCompare( SvTreeListEntry* pLeft, SvTreeListEntry* pRight )
+sal_Int32 DictionaryList::ColumnCompare( SvTreeListEntry* pLeft, SvTreeListEntry* pRight )
{
- StringCompare eCompare=COMPARE_EQUAL;
+ sal_Int32 nCompare = 0;
SvLBoxItem* pLeftItem = getItemAtColumn( pLeft, m_nSortColumnIndex );
SvLBoxItem* pRightItem = getItemAtColumn( pRight, m_nSortColumnIndex );
@@ -390,14 +390,14 @@ StringCompare DictionaryList::ColumnCompare( SvTreeListEntry* pLeft, SvTreeListE
IntlWrapper aIntlWrapper( Application::GetSettings().GetLanguageTag() );
const CollatorWrapper* pCollator = aIntlWrapper.getCaseCollator();
- eCompare=(StringCompare)pCollator->compareString( ((SvLBoxString*)pLeftItem)->GetText(),
+ nCompare = pCollator->compareString( ((SvLBoxString*)pLeftItem)->GetText(),
((SvLBoxString*)pRightItem)->GetText());
- if(eCompare==COMPARE_EQUAL)
- eCompare=COMPARE_LESS;
+ if (nCompare == 0)
+ nCompare = -1;
}
}
- return eCompare;
+ return nCompare;
}
SvLBoxItem* DictionaryList::getItemAtColumn( SvTreeListEntry* pEntry, sal_uInt16 nColumn ) const
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx
index ac645eb..7d76e36 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx
@@ -99,7 +99,7 @@ private:
OUString makeTabString( const DictionaryEntry& rEntry ) const;
DECL_LINK( CompareHdl, SvSortData* );
- StringCompare ColumnCompare( SvTreeListEntry* pLeft, SvTreeListEntry* pRight );
+ sal_Int32 ColumnCompare( SvTreeListEntry* pLeft, SvTreeListEntry* pRight );
SvLBoxItem* getItemAtColumn( SvTreeListEntry* pEntry, sal_uInt16 nColumn ) const;
public:
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index 7dbf550..0705a1c 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -512,7 +512,7 @@ sal_uInt16 SwXServiceProvider::GetProviderType(const OUString& rServiceName)
sal_uInt16 nEntries = sizeof(aProvNamesId) / sizeof(aProvNamesId[0]);
for(sal_uInt16 i = 0; i < nEntries; i++ )
{
- if( COMPARE_EQUAL == rServiceName.compareToAscii(aProvNamesId[i].pName))
+ if (rServiceName.equalsAscii(aProvNamesId[i].pName))
return aProvNamesId[i].nType;
}
return SW_SERVICE_INVALID;
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index b382b2e7..a76c20d 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -2132,7 +2132,7 @@ OUString SwXShape::getImplementationName(void) throw( uno::RuntimeException )
sal_Bool SwXShape::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
sal_Bool bRet = sal_False;
- if(COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.drawing.Shape"))
+ if (rServiceName == "com.sun.star.drawing.Shape")
bRet = sal_True;
else if(xShapeAgg.is())
{
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 7af7f7c..713f299 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -2755,9 +2755,9 @@ OUString SwXTextFrame::getImplementationName(void) throw( uno::RuntimeException
sal_Bool SwXTextFrame::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
- return COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.Text")||
- COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.TextFrame")||
- SwXFrame::supportsService(rServiceName);
+ return rServiceName == "com.sun.star.text.Text" ||
+ rServiceName == "com.sun.star.text.TextFrame" ||
+ SwXFrame::supportsService(rServiceName);
}
uno::Sequence< OUString > SwXTextFrame::getSupportedServiceNames(void) throw( uno::RuntimeException )
@@ -2917,8 +2917,8 @@ OUString SwXTextGraphicObject::getImplementationName(void) throw( uno::RuntimeEx
sal_Bool SwXTextGraphicObject::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
- return COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.TextGraphicObject") ||
- SwXFrame::supportsService(rServiceName);
+ return rServiceName == "com.sun.star.text.TextGraphicObject" ||
+ SwXFrame::supportsService(rServiceName);
}
uno::Sequence< OUString > SwXTextGraphicObject::getSupportedServiceNames(void)
@@ -3178,8 +3178,8 @@ OUString SwXTextEmbeddedObject::getImplementationName(void) throw( uno::RuntimeE
sal_Bool SwXTextEmbeddedObject::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
- return COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.TextEmbeddedObject")||
- SwXFrame::supportsService(rServiceName);
+ return rServiceName == "com.sun.star.text.TextEmbeddedObject" ||
+ SwXFrame::supportsService(rServiceName);
}
uno::Sequence< OUString > SwXTextEmbeddedObject::getSupportedServiceNames(void)
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index e5d5324..cea2d9e 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1655,11 +1655,11 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
bExcept = true;
for(sal_uInt16 j = 0; j < SAL_N_ELEMENTS( aNumPropertyNames ); j++)
{
- if( pDocShell && j >= NotInChapterFirst && j <= NotInChapterLast )
+ if (pDocShell && j >= NotInChapterFirst && j <= NotInChapterLast)
continue;
- if( !pDocShell && j >= InChapterFirst && j <= InChapterLast )
+ if (!pDocShell && j >= InChapterFirst && j <= InChapterLast)
continue;
- if(COMPARE_EQUAL == rProp.Name.compareToAscii(aNumPropertyNames[j]))
+ if (rProp.Name.equalsAscii(aNumPropertyNames[j]))
{
bExcept = false;
break;
diff --git a/sw/source/ui/dbui/dbtree.cxx b/sw/source/ui/dbui/dbtree.cxx
index dbe1365..f31c3dd 100644
--- a/sw/source/ui/dbui/dbtree.cxx
+++ b/sw/source/ui/dbui/dbtree.cxx
@@ -404,7 +404,7 @@ IMPL_LINK( SwDBTreeList, DBCompare, SvSortData*, pData )
SvTreeListEntry* pRight = (SvTreeListEntry*)(pData->pRight );
if (GetParent(pRight) && GetParent(GetParent(pRight)))
- return COMPARE_GREATER; // don't sort column names
+ return 1; // don't sort column names
return DefaultCompare(pData); // otherwise call base class
}
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 96ad632..a9de972 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -691,41 +691,40 @@ sal_Int32 PhysicalFontFace::CompareIgnoreSize( const PhysicalFontFace& rOther )
{
// compare their width, weight, italic and style name
if( GetWidthType() < rOther.GetWidthType() )
- return COMPARE_LESS;
+ return -1;
else if( GetWidthType() > rOther.GetWidthType() )
- return COMPARE_GREATER;
+ return 1;
if( GetWeight() < rOther.GetWeight() )
- return COMPARE_LESS;
+ return -1;
else if( GetWeight() > rOther.GetWeight() )
- return COMPARE_GREATER;
+ return 1;
if( GetSlant() < rOther.GetSlant() )
- return COMPARE_LESS;
+ return -1;
else if( GetSlant() > rOther.GetSlant() )
- return COMPARE_GREATER;
+ return 1;
- sal_Int32 eCompare = GetFamilyName().compareTo( rOther.GetFamilyName() );
- return eCompare;
+ return GetFamilyName().compareTo( rOther.GetFamilyName() );
}
sal_Int32 PhysicalFontFace::CompareWithSize( const PhysicalFontFace& rOther ) const
{
- sal_Int32 eCompare = CompareIgnoreSize( rOther );
- if( eCompare != COMPARE_EQUAL )
- return eCompare;
+ sal_Int32 nCompare = CompareIgnoreSize( rOther );
+ if (nCompare != 0)
+ return nCompare;
if( mnHeight < rOther.mnHeight )
- return COMPARE_LESS;
+ return -1;
else if( mnHeight > rOther.mnHeight )
- return COMPARE_GREATER;
+ return 1;
if( mnWidth < rOther.mnWidth )
- return COMPARE_LESS;
+ return -1;
else if( mnWidth > rOther.mnWidth )
- return COMPARE_GREATER;
+ return 1;
- return COMPARE_EQUAL;
+ return 0;
}
struct FontMatchStatus
@@ -1030,9 +1029,9 @@ bool ImplDevFontListData::AddFontFace( PhysicalFontFace* pNewData )
for(; (pData=*ppHere) != NULL; ppHere=&pData->mpNext )
{
sal_Int32 eComp = pNewData->CompareWithSize( *pData );
- if( eComp == COMPARE_GREATER )
+ if( eComp > 0 )
continue;
- if( eComp == COMPARE_LESS )
+ if( eComp < 0 )
break;
// ignore duplicate if its quality is worse
commit 958f7b512cff932f7f2d52d128c297d0f0ab6354
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Oct 21 11:31:31 2013 +0100
drop CharSet typedef
Change-Id: Ia160d7cbaa2ee71773483c3f91306f89cdad5947
diff --git a/include/tools/string.hxx b/include/tools/string.hxx
index 21eb3c5..6904e0e 100644
--- a/include/tools/string.hxx
+++ b/include/tools/string.hxx
@@ -50,15 +50,6 @@ class UniString;
RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT |\
RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT)
-// CharSet
-
-#ifndef ENUM_CHARSET_DECLARED
-#define ENUM_CHARSET_DECLARED
-
-typedef rtl_TextEncoding CharSet;
-
-#endif
-
// String-Types
#ifdef STRING32
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index d623efa..2f16a6b 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -451,7 +451,7 @@ public:
void CompileNameFormula( bool bCreateFormulaString );
void CompileColRowNameFormula();
- sal_Int32 GetMaxStringLen( SCROW nRowStart, SCROW nRowEnd, CharSet eCharSet ) const;
+ sal_Int32 GetMaxStringLen( SCROW nRowStart, SCROW nRowEnd, rtl_TextEncoding eCharSet ) const;
xub_StrLen GetMaxNumberStringLen( sal_uInt16& nPrecision,
SCROW nRowStart, SCROW nRowEnd ) const;
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 2ab016a..a843c60 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -824,7 +824,7 @@ public:
bool HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) const;
sal_Int32 GetMaxStringLen( SCCOL nCol,
- SCROW nRowStart, SCROW nRowEnd, CharSet eCharSet ) const;
+ SCROW nRowStart, SCROW nRowEnd, rtl_TextEncoding eCharSet ) const;
xub_StrLen GetMaxNumberStringLen( sal_uInt16& nPrecision,
SCCOL nCol,
SCROW nRowStart, SCROW nRowEnd ) const;
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 02ed182..e656d51 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2475,7 +2475,7 @@ class MaxStringLenHandler
sal_Int32 mnMaxLen;
const ScColumn& mrColumn;
SvNumberFormatter* mpFormatter;
- CharSet meCharSet;
+ rtl_TextEncoding meCharSet;
bool mbOctetEncoding;
void processCell(size_t nRow, ScRefCellValue& rCell)
@@ -2507,7 +2507,7 @@ class MaxStringLenHandler
}
public:
- MaxStringLenHandler(const ScColumn& rColumn, CharSet eCharSet) :
+ MaxStringLenHandler(const ScColumn& rColumn, rtl_TextEncoding eCharSet) :
mnMaxLen(0),
mrColumn(rColumn),
mpFormatter(rColumn.GetDoc().GetFormatTable()),
@@ -2545,7 +2545,7 @@ public:
}
-sal_Int32 ScColumn::GetMaxStringLen( SCROW nRowStart, SCROW nRowEnd, CharSet eCharSet ) const
+sal_Int32 ScColumn::GetMaxStringLen( SCROW nRowStart, SCROW nRowEnd, rtl_TextEncoding eCharSet ) const
{
MaxStringLenHandler aFunc(*this, eCharSet);
sc::ParseAllNonEmpty(maCells.begin(), maCells, nRowStart, nRowEnd, aFunc);
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index d5e8429..590737c 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -588,7 +588,7 @@ void ScDocument::InvalidateTableArea()
}
sal_Int32 ScDocument::GetMaxStringLen( SCTAB nTab, SCCOL nCol,
- SCROW nRowStart, SCROW nRowEnd, CharSet eCharSet ) const
+ SCROW nRowStart, SCROW nRowEnd, rtl_TextEncoding eCharSet ) const
{
if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab])
return maTabs[nTab]->GetMaxStringLen( nCol, nRowStart, nRowEnd, eCharSet );
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index 3d9110b..6f339fb 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -553,7 +553,7 @@ void ScDocument::UpdateFontCharSet()
bool bUpdateOld = ( nSrcVer < SC_FONTCHARSET );
- CharSet eSysSet = osl_getThreadTextEncoding();
+ rtl_TextEncoding eSysSet = osl_getThreadTextEncoding();
if ( eSrcSet != eSysSet || bUpdateOld )
{
sal_uInt32 nCount,i;
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 6a99807..0b76d33 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -688,7 +688,7 @@ void ScGlobal::Clear()
//------------------------------------------------------------------------
-CharSet ScGlobal::GetCharsetValue( const OUString& rCharSet )
+rtl_TextEncoding ScGlobal::GetCharsetValue( const OUString& rCharSet )
{
// new TextEncoding values
if ( CharClass::isAsciiNumeric( rCharSet ) )
@@ -696,7 +696,7 @@ CharSet ScGlobal::GetCharsetValue( const OUString& rCharSet )
sal_Int32 nVal = rCharSet.toInt32();
if ( !nVal || nVal == RTL_TEXTENCODING_DONTKNOW )
return osl_getThreadTextEncoding();
- return (CharSet) nVal;
+ return (rtl_TextEncoding) nVal;
}
// old CharSet values for compatibility
else if (rCharSet.equalsIgnoreAsciiCase("ANSI") ) return RTL_TEXTENCODING_MS_1252;
@@ -713,7 +713,7 @@ CharSet ScGlobal::GetCharsetValue( const OUString& rCharSet )
//------------------------------------------------------------------------
-OUString ScGlobal::GetCharsetString( CharSet eVal )
+OUString ScGlobal::GetCharsetString( rtl_TextEncoding eVal )
{
const sal_Char* pChar;
switch ( eVal )
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 1e21621..61aa637 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2330,7 +2330,7 @@ sal_uLong ScTable::GetCodeCount() const
}
sal_Int32 ScTable::GetMaxStringLen( SCCOL nCol, SCROW nRowStart,
- SCROW nRowEnd, CharSet eCharSet ) const
+ SCROW nRowEnd, rtl_TextEncoding eCharSet ) const
{
if ( ValidCol(nCol) )
return aCol[nCol].GetMaxStringLen( nRowStart, nRowEnd, eCharSet );
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index a77f0ec..33ba889 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -28,6 +28,7 @@
#include <sal/macros.h>
#include <tools/rcid.h>
#include <tools/solar.h>
+#include <tools/string.hxx>
#include <unotools/charclass.hxx>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/sheet/FormulaOpCodeMapEntry.hpp>
diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx
index 94dd320..d3c6ee4 100644
--- a/sc/source/filter/excel/excel.cxx
+++ b/sc/source/filter/excel/excel.cxx
@@ -144,7 +144,7 @@ FltError ScFormatFilterPluginImpl::ScImportExcel( SfxMedium& rMedium, ScDocument
static FltError lcl_ExportExcelBiff( SfxMedium& rMedium, ScDocument *pDocument,
- SvStream* pMedStrm, sal_Bool bBiff8, CharSet eNach )
+ SvStream* pMedStrm, sal_Bool bBiff8, rtl_TextEncoding eNach )
{
// try to open an OLE storage
SotStorageRef xRootStrg = new SotStorage( pMedStrm, false );
@@ -198,7 +198,7 @@ static FltError lcl_ExportExcelBiff( SfxMedium& rMedium, ScDocument *pDocument,
}
FltError ScFormatFilterPluginImpl::ScExportExcel5( SfxMedium& rMedium, ScDocument *pDocument,
- ExportFormatExcel eFormat, CharSet eNach )
+ ExportFormatExcel eFormat, rtl_TextEncoding eNach )
{
if( eFormat != ExpBiff5 && eFormat != ExpBiff8 )
return eERR_NI;
diff --git a/sc/source/filter/excel/fontbuff.cxx b/sc/source/filter/excel/fontbuff.cxx
index 27c15ae..2d0dbba 100644
--- a/sc/source/filter/excel/fontbuff.cxx
+++ b/sc/source/filter/excel/fontbuff.cxx
@@ -121,7 +121,7 @@ void LotusFontBuffer::MakeFont( ENTRY* pEntry )
{
FontFamily eFamily = FAMILY_DONTKNOW;
FontPitch ePitch = PITCH_DONTKNOW;
- CharSet eCharSet = RTL_TEXTENCODING_DONTKNOW;
+ rtl_TextEncoding eCharSet = RTL_TEXTENCODING_DONTKNOW;
switch( pEntry->nType )
{
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index eea5948..e8caace 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -90,7 +90,7 @@ const double ImportExcel::fExcToTwips =
( double ) TWIPS_PER_CHAR / 256.0;
-ImportTyp::ImportTyp( ScDocument* pDoc, CharSet eQ )
+ImportTyp::ImportTyp( ScDocument* pDoc, rtl_TextEncoding eQ )
{
eQuellChar = eQ;
pD = pDoc;
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index c14bd66..0849729 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -133,7 +133,7 @@ const sal_Char ScHTMLExport::sIndentSource[nIndentMax+1] =
//========================================================================
FltError ScFormatFilterPluginImpl::ScExportHTML( SvStream& rStrm, const OUString& rBaseURL, ScDocument* pDoc,
- const ScRange& rRange, const CharSet /*eNach*/, bool bAll,
+ const ScRange& rRange, const rtl_TextEncoding /*eNach*/, bool bAll,
const OUString& rStreamPath, OUString& rNonConvertibleChars )
{
ScHTMLExport aEx( rStrm, rBaseURL, pDoc, rRange, bAll, rStreamPath );
diff --git a/sc/source/filter/inc/imp_op.hxx b/sc/source/filter/inc/imp_op.hxx
index 7fafecf..26fafa6 100644
--- a/sc/source/filter/inc/imp_op.hxx
+++ b/sc/source/filter/inc/imp_op.hxx
@@ -48,11 +48,11 @@ class ExcelToSc;
class ImportTyp
{
protected:
- CharSet eQuellChar; // Quell-Zeichensatz
+ rtl_TextEncoding eQuellChar; // Quell-Zeichensatz
ScDocument* pD; // Dokument
public:
- ImportTyp( ScDocument*, CharSet eSrc );
+ ImportTyp( ScDocument*, rtl_TextEncoding eSrc );
virtual ~ImportTyp();
virtual FltError Read( void );
diff --git a/sc/source/filter/inc/lotform.hxx b/sc/source/filter/inc/lotform.hxx
index ae07457..f805edb 100644
--- a/sc/source/filter/inc/lotform.hxx
+++ b/sc/source/filter/inc/lotform.hxx
@@ -62,7 +62,7 @@ enum FUNC_TYPE
class LotusToSc : public LotusConverterBase
{
private:
- CharSet eSrcChar;
+ rtl_TextEncoding eSrcChar;
TokenId nAddToken; // ')+1.0'
TokenId nSubToken; // ~
TokenId n0Token; // '0.0';
@@ -88,7 +88,7 @@ private:
void NegToken( TokenId& rParam );
// ACHTUNG: wie ~, nur wird '-(<rParam>)' gebildet
public:
- LotusToSc( SvStream& aStr, CharSet eSrc, sal_Bool b );
+ LotusToSc( SvStream& aStr, rtl_TextEncoding eSrc, sal_Bool b );
virtual ConvErr Convert( const ScTokenArray*& rpErg, sal_Int32& nRest,
const FORMULA_TYPE eFT = FT_CellFormula );
diff --git a/sc/source/filter/inc/lotimpop.hxx b/sc/source/filter/inc/lotimpop.hxx
index 61a0066..ed1c492 100644
--- a/sc/source/filter/inc/lotimpop.hxx
+++ b/sc/source/filter/inc/lotimpop.hxx
@@ -78,7 +78,7 @@ private:
inline void Skip( const sal_uInt16 nNumBytes );
// -------------------------------------------------------------------
public:
- ImportLotus( SvStream&, ScDocument*, CharSet eSrc );
+ ImportLotus( SvStream&, ScDocument*, rtl_TextEncoding eSrc );
virtual ~ImportLotus();
diff --git a/sc/source/filter/lotus/filter.cxx b/sc/source/filter/lotus/filter.cxx
index b54233a..7771234 100644
--- a/sc/source/filter/lotus/filter.cxx
+++ b/sc/source/filter/lotus/filter.cxx
@@ -54,8 +54,8 @@ WKTYP eTyp;
extern sal_Bool bEOF; // zeigt Ende der Datei
sal_Bool bEOF;
-extern CharSet eCharVon;
-CharSet eCharVon;
+extern rtl_TextEncoding eCharVon;
+rtl_TextEncoding eCharVon;
extern ScDocument* pDoc; // Aufhaenger zum Dokumentzugriff
ScDocument* pDoc;
@@ -200,7 +200,7 @@ WKTYP ScanVersion( SvStream& aStream )
return eWK_UNKNOWN;
}
-FltError ScImportLotus123old( SvStream& aStream, ScDocument* pDocument, CharSet eSrc )
+FltError ScImportLotus123old( SvStream& aStream, ScDocument* pDocument, rtl_TextEncoding eSrc )
{
aStream.Seek( 0UL );
diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx
index 7e9e1d0..f09c114 100644
--- a/sc/source/filter/lotus/lotform.cxx
+++ b/sc/source/filter/lotus/lotform.cxx
@@ -341,7 +341,7 @@ void LotusToSc::Reset( const ScAddress& rEingPos )
}
-LotusToSc::LotusToSc( SvStream &rStream, CharSet e, sal_Bool b ) :
+LotusToSc::LotusToSc( SvStream &rStream, rtl_TextEncoding e, sal_Bool b ) :
LotusConverterBase( rStream, 128 )
{
eSrcChar = e;
diff --git a/sc/source/filter/lotus/lotimpop.cxx b/sc/source/filter/lotus/lotimpop.cxx
index 64663cf..ad27360 100644
--- a/sc/source/filter/lotus/lotimpop.cxx
+++ b/sc/source/filter/lotus/lotimpop.cxx
@@ -38,7 +38,7 @@
#include "lotattr.hxx"
#include "stringutil.hxx"
-LOTUS_ROOT::LOTUS_ROOT( ScDocument* pDocP, CharSet eQ )
+LOTUS_ROOT::LOTUS_ROOT( ScDocument* pDocP, rtl_TextEncoding eQ )
:
pDoc( pDocP),
pRangeNames( new LotusRangeList),
@@ -65,7 +65,7 @@ LOTUS_ROOT::~LOTUS_ROOT()
static osl::Mutex aLotImpSemaphore;
-ImportLotus::ImportLotus( SvStream& aStream, ScDocument* pDoc, CharSet eQ ) :
+ImportLotus::ImportLotus( SvStream& aStream, ScDocument* pDoc, rtl_TextEncoding eQ ) :
ImportTyp( pDoc, eQ ),
pIn( &aStream ),
aConv( *pIn, eQ, false )
diff --git a/sc/source/filter/lotus/lotus.cxx b/sc/source/filter/lotus/lotus.cxx
index 2e752fc..eb6621a 100644
--- a/sc/source/filter/lotus/lotus.cxx
+++ b/sc/source/filter/lotus/lotus.cxx
@@ -29,10 +29,10 @@
//------------------------------------------------------------------------
-extern FltError ScImportLotus123old( SvStream&, ScDocument*, CharSet eSrc );
+extern FltError ScImportLotus123old( SvStream&, ScDocument*, rtl_TextEncoding eSrc );
// alter Krempel in filter.cxx!
-FltError ScFormatFilterPluginImpl::ScImportLotus123( SfxMedium& rMedium, ScDocument* pDocument, CharSet eSrc )
+FltError ScFormatFilterPluginImpl::ScImportLotus123( SfxMedium& rMedium, ScDocument* pDocument, rtl_TextEncoding eSrc )
{
ScFilterOptions aFilterOpt;
sal_Bool bWithWK3 = aFilterOpt.GetWK3Flag();
diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx
index ba1522a..9e777a7 100644
--- a/sc/source/filter/lotus/op.cxx
+++ b/sc/source/filter/lotus/op.cxx
@@ -57,8 +57,8 @@
extern WKTYP eTyp; // -> filter.cxx, aktueller Dateityp
extern sal_Bool bEOF; // -> filter.cxx, zeigt Dateiende an
extern sal_uInt8 nDefaultFormat; // -> tool.cxx, Default-Zellenformat
-extern ScDocument* pDoc; // -> filter.cxx, Aufhaenger zum Dokumentzugriff
-extern CharSet eCharVon; // -> filter.cxx, character set specified
+extern ScDocument* pDoc; // -> filter.cxx, Aufhaenger zum Dokumentzugriff
+extern rtl_TextEncoding eCharVon; // -> filter.cxx, character set specified
static sal_uInt16 nDefWidth = ( sal_uInt16 ) ( TWIPS_PER_CHAR * 10 );
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx
index 787f960..89c13d8 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -676,7 +676,7 @@ IMPL_LINK( ScImportAsciiDlg, CharSetHdl, SvxTextEncodingBox*, pCharSetBox )
if( (pCharSetBox == pLbCharSet) && (pCharSetBox->GetSelectEntryCount() == 1) )
{
SetPointer( Pointer( POINTER_WAIT ) );
- CharSet eOldCharSet = meCharSet;
+ rtl_TextEncoding eOldCharSet = meCharSet;
SetSelectedCharSet();
// switching char-set invalidates 8bit -> String conversions
if (eOldCharSet != meCharSet)
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 386eddb..6da65ad 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -1771,12 +1771,12 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
{
sal_Unicode cDelim = rAsciiOpt.nFieldSepCode;
sal_Unicode cStrDelim = rAsciiOpt.nTextSepCode;
- CharSet eCharSet = rAsciiOpt.eCharSet;
+ rtl_TextEncoding eCharSet = rAsciiOpt.eCharSet;
bool bFixedWidth = rAsciiOpt.bFixedWidth;
bool bSaveAsShown = rAsciiOpt.bSaveAsShown;
bool bShowFormulas = rAsciiOpt.bSaveFormulas;
- CharSet eOldCharSet = rStream.GetStreamCharSet();
+ rtl_TextEncoding eOldCharSet = rStream.GetStreamCharSet();
rStream.SetStreamCharSet( eCharSet );
sal_uInt16 nOldNumberFormatInt = rStream.GetNumberFormatInt();
OString aStrDelimEncoded; // only used if not Unicode
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 5fa6795..87a7226 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -291,7 +291,7 @@ static void lcl_setScalesToColumns(ScDocument& rDoc, const vector<long>& rScales
#endif // !DISABLE_DBCONNECTIVITY
-sal_uLong ScDocShell::DBaseImport( const OUString& rFullFileName, CharSet eCharSet,
+sal_uLong ScDocShell::DBaseImport( const OUString& rFullFileName, rtl_TextEncoding eCharSet,
ScColWidthParam aColWidthParam[MAXCOLCOUNT], ScFlatBoolRowSegments& rRowHeightsRecalc )
{
#ifdef DISABLE_DBCONNECTIVITY
@@ -486,7 +486,7 @@ inline bool IsAsciiAlpha( sal_Unicode c )
void lcl_GetColumnTypes(
ScDocShell& rDocShell, const ScRange& rDataRange, bool bHasFieldNames,
OUString* pColNames, sal_Int32* pColTypes, sal_Int32* pColLengths,
- sal_Int32* pColScales, bool& bHasMemo, CharSet eCharSet )
+ sal_Int32* pColScales, bool& bHasMemo, rtl_TextEncoding eCharSet )
{
// updating of column titles didn't work in 5.2 and isn't always wanted
// (saving normally shouldn't modify the document)
@@ -770,7 +770,7 @@ inline void lcl_getLongVarCharString(
#endif // !DISABLE_DBCONNECTIVITY
-sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, CharSet eCharSet, bool& bHasMemo )
+sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncoding eCharSet, bool& bHasMemo )
{
#ifdef DISABLE_DBCONNECTIVITY
(void) rFullFileName;
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index d2c1d1e..93f9782 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -2212,7 +2212,7 @@ class ScFormatFilterMissing : public ScFormatFilterPlugin {
virtual FltError ScImportExcel( SfxMedium&, ScDocument*, const EXCIMPFORMAT ) RETURN_ERROR
virtual FltError ScImportStarCalc10( SvStream&, ScDocument* ) RETURN_ERROR
virtual FltError ScImportDif( SvStream&, ScDocument*, const ScAddress&,
- const CharSet, sal_uInt32 ) RETURN_ERROR
+ const rtl_TextEncoding, sal_uInt32 ) RETURN_ERROR
virtual FltError ScImportRTF( SvStream&, const OUString&, ScDocument*, ScRange& ) RETURN_ERROR
virtual FltError ScImportHTML( SvStream&, const OUString&, ScDocument*, ScRange&, double, bool, SvNumberFormatter*, bool ) RETURN_ERROR
@@ -2221,9 +2221,9 @@ class ScFormatFilterMissing : public ScFormatFilterPlugin {
virtual OUString GetHTMLRangeNameList( ScDocument*, const OUString& ) { return OUString(); }
virtual FltError ScExportExcel5( SfxMedium&, ScDocument*, ExportFormatExcel, rtl_TextEncoding ) RETURN_ERROR
- virtual FltError ScExportDif( SvStream&, ScDocument*, const ScAddress&, const CharSet, sal_uInt32 ) RETURN_ERROR
- virtual FltError ScExportDif( SvStream&, ScDocument*, const ScRange&, const CharSet, sal_uInt32 ) RETURN_ERROR
- virtual FltError ScExportHTML( SvStream&, const OUString&, ScDocument*, const ScRange&, const CharSet, bool,
+ virtual FltError ScExportDif( SvStream&, ScDocument*, const ScAddress&, const rtl_TextEncoding, sal_uInt32 ) RETURN_ERROR
+ virtual FltError ScExportDif( SvStream&, ScDocument*, const ScRange&, const rtl_TextEncoding, sal_uInt32 ) RETURN_ERROR
+ virtual FltError ScExportHTML( SvStream&, const OUString&, ScDocument*, const ScRange&, const rtl_TextEncoding, bool,
const OUString&, OUString& ) RETURN_ERROR
virtual FltError ScExportRTF( SvStream&, ScDocument*, const ScRange&, const rtl_TextEncoding ) RETURN_ERROR
diff --git a/sc/source/ui/inc/asciiopt.hxx b/sc/source/ui/inc/asciiopt.hxx
index 9f1200e..c114d38 100644
--- a/sc/source/ui/inc/asciiopt.hxx
+++ b/sc/source/ui/inc/asciiopt.hxx
@@ -44,7 +44,7 @@ private:
bool bQuotedFieldAsText;
bool bDetectSpecialNumber;
sal_Unicode cTextSep;
- CharSet eCharSet;
+ rtl_TextEncoding eCharSet;
LanguageType eLang;
bool bCharSetSystem;
long nStartRow;
@@ -68,7 +68,7 @@ public:
void InterpretColumnList( const OUString& rString );
- CharSet GetCharSet() const { return eCharSet; }
+ rtl_TextEncoding GetCharSet() const { return eCharSet; }
bool GetCharSetSystem() const { return bCharSetSystem; }
const OUString& GetFieldSeps() const { return aFieldSeps; }
bool IsMergeSeps() const { return bMergeFieldSeps; }
@@ -82,7 +82,7 @@ public:
long GetStartRow() const { return nStartRow; }
LanguageType GetLanguage() const { return eLang; }
- void SetCharSet( CharSet eNew ) { eCharSet = eNew; }
+ void SetCharSet( rtl_TextEncoding eNew ) { eCharSet = eNew; }
void SetCharSetSystem( bool bSet ) { bCharSetSystem = bSet; }
void SetFixedLen( bool bSet ) { bFixedLen = bSet; }
void SetFieldSeps( const OUString& rStr ) { aFieldSeps = rStr; }
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index 1e1808b..20a4833 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -143,10 +143,10 @@ class SC_DLLPUBLIC ScDocShell: public SfxObjectShell, public SfxListener
SC_DLLPRIVATE bool SaveCurrentChart( SfxMedium& rMedium );
- SC_DLLPRIVATE sal_uLong DBaseImport( const OUString& rFullFileName, CharSet eCharSet,
+ SC_DLLPRIVATE sal_uLong DBaseImport( const OUString& rFullFileName, rtl_TextEncoding eCharSet,
ScColWidthParam aColWidthParam[MAXCOLCOUNT], ScFlatBoolRowSegments& rRowHeightsRecalc );
SC_DLLPRIVATE sal_uLong DBaseExport(
- const OUString& rFullFileName, CharSet eCharSet, bool& bHasMemo );
+ const OUString& rFullFileName, rtl_TextEncoding eCharSet, bool& bHasMemo );
SC_DLLPRIVATE static bool MoveFile( const INetURLObject& rSource, const INetURLObject& rDest );
SC_DLLPRIVATE static bool KillFile( const INetURLObject& rURL );
diff --git a/sc/source/ui/inc/imoptdlg.hxx b/sc/source/ui/inc/imoptdlg.hxx
index a8b45ab..26b506b 100644
--- a/sc/source/ui/inc/imoptdlg.hxx
+++ b/sc/source/ui/inc/imoptdlg.hxx
@@ -94,7 +94,7 @@ public:
sal_Unicode nFieldSepCode;
sal_Unicode nTextSepCode;
OUString aStrFont;
- CharSet eCharSet;
+ rtl_TextEncoding eCharSet;
sal_Bool bFixedWidth;
sal_Bool bSaveAsShown;
sal_Bool bQuoteAllText;
diff --git a/sc/source/ui/inc/scuiasciiopt.hxx b/sc/source/ui/inc/scuiasciiopt.hxx
index 68ed4e2..514bec8 100644
--- a/sc/source/ui/inc/scuiasciiopt.hxx
+++ b/sc/source/ui/inc/scuiasciiopt.hxx
@@ -76,7 +76,7 @@ class ScImportAsciiDlg : public ModalDialog
OUString maFieldSeparators; // selected field separators
sal_Unicode mcTextSep;
- CharSet meCharSet; /// Selected char set.
+ rtl_TextEncoding meCharSet; /// Selected char set.
bool mbCharSetSystem; /// Is System char set selected?
ScImportAsciiCall meCall; /// How the dialog is called (see asciiopt.hxx)
diff --git a/sw/inc/iodetect.hxx b/sw/inc/iodetect.hxx
index ef9933d..c77ee2d 100644
--- a/sw/inc/iodetect.hxx
+++ b/sw/inc/iodetect.hxx
@@ -108,7 +108,7 @@ public:
SWD_DLLPUBLIC static bool
IsDetectableText( const sal_Char* pBuf, sal_uLong &rLen,
- CharSet *pCharSet=0, bool *pSwap=0, LineEnd *pLineEnd=0, bool bEncodedFilter = false );
+ rtl_TextEncoding *pCharSet=0, bool *pSwap=0, LineEnd *pLineEnd=0, bool bEncodedFilter = false );
static const SfxFilter* GetTextFilter( const sal_Char* pBuf, sal_uLong nLen );
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index cfb57994..80e8761 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -473,7 +473,7 @@ sal_Bool SwBoxAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions, s
{
sal_uInt16 eSys, eLge;
// --- from 680/dr25 on: store strings as UTF-8
- CharSet eCharSet = (nVer >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
+ rtl_TextEncoding eCharSet = (nVer >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
sNumFmtString = rStream.ReadUniOrByteString( eCharSet );
rStream >> eSys >> eLge;
eSysLanguage = (LanguageType) eSys;
@@ -908,7 +908,7 @@ sal_Bool SwTableAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions
{
sal_Bool b;
// --- from 680/dr25 on: store strings as UTF-8
- CharSet eCharSet = (nVal >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
+ rtl_TextEncoding eCharSet = (nVal >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
m_aName = rStream.ReadUniOrByteString( eCharSet );
if( AUTOFORMAT_DATA_ID_552 <= nVal )
{
@@ -1154,7 +1154,7 @@ sal_Bool SwTableAutoFmtTbl::Load( SvStream& rStream )
OSL_ENSURE( !this, "The Header contains more or newer Data" );
rStream.Seek( nPos + nCnt );
}
- rStream.SetStreamCharSet( (CharSet)nChrSet );
+ rStream.SetStreamCharSet( (rtl_TextEncoding)nChrSet );
rStream.SetVersion( nFileVers );
}
diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index 8f7338f..6df1dd2 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -84,7 +84,7 @@ class SwSubFont : public SvxFont
inline void SetColor( const Color& rColor );
inline void SetFillColor( const Color& rColor );
- inline void SetCharSet( const CharSet eCharSet );
+ inline void SetCharSet( const rtl_TextEncoding eCharSet );
inline void SetPitch( const FontPitch ePitch );
inline void SetAlign( const FontAlign eAlign );
inline void SetUnderline( const FontUnderline eUnderline );
@@ -236,7 +236,7 @@ public:
inline void SetWeight( const FontWeight eWeight, const sal_uInt8 nWhich );
inline void SetItalic( const FontItalic eItalic, const sal_uInt8 nWhich );
inline void SetLanguage( LanguageType eNewLang, const sal_uInt8 nWhich );
- inline void SetCharSet( const CharSet eCharSet, const sal_uInt8 nWhich );
+ inline void SetCharSet( const rtl_TextEncoding eCharSet, const sal_uInt8 nWhich );
inline void SetPitch( const FontPitch ePitch, const sal_uInt8 nWhich );
inline void SetRelief( const FontRelief eNew );
@@ -513,13 +513,13 @@ inline void SwFont::SetStyleName( const OUString& rStyle, const sal_uInt8 nWhich
}
// gekapselte SV-Font-Methode
-inline void SwSubFont::SetCharSet( const CharSet eCharSet )
+inline void SwSubFont::SetCharSet( const rtl_TextEncoding eCharSet )
{
pMagic = 0;
Font::SetCharSet( eCharSet );
}
-inline void SwFont::SetCharSet( const CharSet eCharSet, const sal_uInt8 nWhich )
+inline void SwFont::SetCharSet( const rtl_TextEncoding eCharSet, const sal_uInt8 nWhich )
{
bFntChg = sal_True;
aSub[nWhich].SetCharSet( eCharSet );
diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx
index e1138d3..9351dc0 100644
--- a/sw/source/filter/basflt/iodetect.cxx
+++ b/sw/source/filter/basflt/iodetect.cxx
@@ -404,10 +404,10 @@ const SfxFilter* SwIoSystem::GetFileFilter(const OUString& rFileName,
}
bool SwIoSystem::IsDetectableText(const sal_Char* pBuf, sal_uLong &rLen,
- CharSet *pCharSet, bool *pSwap, LineEnd *pLineEnd, bool bEncodedFilter)
+ rtl_TextEncoding *pCharSet, bool *pSwap, LineEnd *pLineEnd, bool bEncodedFilter)
{
bool bSwap = false;
- CharSet eCharSet = RTL_TEXTENCODING_DONTKNOW;
+ rtl_TextEncoding eCharSet = RTL_TEXTENCODING_DONTKNOW;
bool bLE = true;
/*See if it's a known unicode type*/
if (rLen >= 2)
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 50354b3..313b423 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2395,7 +2395,7 @@ bool SwWW8ImplReader::ProcessSpecial(bool &rbReSync, WW8_CP nStartCp)
return bTableRowEnd;
}
-CharSet SwWW8ImplReader::GetCurrentCharSet()
+rtl_TextEncoding SwWW8ImplReader::GetCurrentCharSet()
{
/*
#i2015
@@ -2403,7 +2403,7 @@ CharSet SwWW8ImplReader::GetCurrentCharSet()
character run that has set the charset, if not then fallback to the
current underlying paragraph style.
*/
- CharSet eSrcCharSet = eHardCharSet;
+ rtl_TextEncoding eSrcCharSet = eHardCharSet;
if (eSrcCharSet == RTL_TEXTENCODING_DONTKNOW)
{
if (!maFontSrcCharSets.empty())
@@ -2434,7 +2434,7 @@ CharSet SwWW8ImplReader::GetCurrentCharSet()
}
//Takashi Ono for CJK
-CharSet SwWW8ImplReader::GetCurrentCJKCharSet()
+rtl_TextEncoding SwWW8ImplReader::GetCurrentCJKCharSet()
{
/*
#i2015
@@ -2442,7 +2442,7 @@ CharSet SwWW8ImplReader::GetCurrentCJKCharSet()
character run that has set the charset, if not then fallback to the
current underlying paragraph style.
*/
- CharSet eSrcCharSet = eHardCharSet;
+ rtl_TextEncoding eSrcCharSet = eHardCharSet;
if (eSrcCharSet == RTL_TEXTENCODING_DONTKNOW)
{
if (!maFontSrcCJKCharSets.empty())
@@ -2652,9 +2652,9 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, long nEnd, long nCpOfs)
else
nStrLen = STRING_MAXLEN-1;
- const CharSet eSrcCharSet = bVer67 ? GetCurrentCharSet() :
+ const rtl_TextEncoding eSrcCharSet = bVer67 ? GetCurrentCharSet() :
RTL_TEXTENCODING_MS_1252;
- const CharSet eSrcCJKCharSet = bVer67 ? GetCurrentCJKCharSet() :
+ const rtl_TextEncoding eSrcCJKCharSet = bVer67 ? GetCurrentCJKCharSet() :
RTL_TEXTENCODING_MS_1252;
// allocate unicode string data
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 775137e..789a5a6 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -312,8 +312,8 @@ public:
{
return pOutlineNumrule;
}
- CharSet GetCharSet() const;
- CharSet GetCJKCharSet() const;
+ rtl_TextEncoding GetCharSet() const;
+ rtl_TextEncoding GetCJKCharSet() const;
};
//-----------------------------------------
@@ -1808,8 +1808,8 @@ public: // eigentlich private, geht aber leider nur public
const OUString& GetBaseURL() const { return sBaseURL; }
// Laden eines kompletten DocFiles
sal_uLong LoadDoc( SwPaM&,WW8Glossary *pGloss=0);
- CharSet GetCurrentCharSet();
- CharSet GetCurrentCJKCharSet();
+ rtl_TextEncoding GetCurrentCharSet();
+ rtl_TextEncoding GetCurrentCJKCharSet();
void PostProcessAttrs();
};
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 88d30f2..70492ba 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -598,7 +598,7 @@ void SwWW8ImplReader::SetAnlvStrings(SwNumFmt &rNum, WW8_ANLV &rAV,
const sal_uInt8* pTxt, bool bOutline)
{
bool bInsert = false; // Default
- CharSet eCharSet = eStructCharSet;
+ rtl_TextEncoding eCharSet = eStructCharSet;
const WW8_FFN* pF = pFonts->GetFont(SVBT16ToShort(rAV.ftc)); // FontInfo
bool bListSymbol = pF && ( pF->chs == 2 ); // Symbol/WingDings/...
@@ -4472,14 +4472,14 @@ void WW8RStyle::Import()
pIo->pAktColl = 0;
}
-CharSet SwWW8StyInf::GetCharSet() const
+rtl_TextEncoding SwWW8StyInf::GetCharSet() const
{
if ((pFmt) && (pFmt->GetFrmDir().GetValue() == FRMDIR_HORI_RIGHT_TOP))
return eRTLFontSrcCharSet;
return eLTRFontSrcCharSet;
}
-CharSet SwWW8StyInf::GetCJKCharSet() const
+rtl_TextEncoding SwWW8StyInf::GetCJKCharSet() const
{
if ((pFmt) && (pFmt->GetFrmDir().GetValue() == FRMDIR_HORI_RIGHT_TOP))
return eRTLFontSrcCharSet;
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index ba481f3..5a72a19 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -2146,7 +2146,7 @@ eF_ResT SwWW8ImplReader::Read_F_Macro( WW8FieldDesc*, OUString& rStr)
FontFamily eFamily;
OUString aFontName;
FontPitch ePitch;
- CharSet eSrcCharSet;
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list