diff options
-rw-r--r-- | include/tools/string.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unocoll.cxx | 7 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.hxx | 1 | ||||
-rw-r--r-- | tools/source/string/strascii.cxx | 70 | ||||
-rw-r--r-- | tools/source/string/tustring.cxx | 1 |
5 files changed, 3 insertions, 78 deletions
diff --git a/include/tools/string.hxx b/include/tools/string.hxx index 796971ef2942..8441ac05453c 100644 --- a/include/tools/string.hxx +++ b/include/tools/string.hxx @@ -224,8 +224,6 @@ public: StringCompare CompareTo( const UniString& rStr, xub_StrLen nLen = STRING_LEN ) const; - StringCompare CompareToAscii( const sal_Char* pAsciiStr, - xub_StrLen nLen = STRING_LEN ) const; sal_Bool Equals( const UniString& rStr ) const; sal_Bool Equals( const UniString& rStr, xub_StrLen nIndex, xub_StrLen nLen ) const; diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 2807f5b70725..a5d86ef914eb 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -1543,19 +1543,18 @@ uno::Sequence< OUString > SwXTextSections::getElementNames(void) return aSeq; } -sal_Bool SwXTextSections::hasByName(const OUString& Name) +sal_Bool SwXTextSections::hasByName(const OUString& rName) throw( uno::RuntimeException ) { SolarMutexGuard aGuard; sal_Bool bRet = sal_False; - String aName(Name); if(IsValid()) { SwSectionFmts& rFmts = GetDoc()->GetSections(); for(sal_uInt16 i = 0; i < rFmts.size(); i++) { const SwSectionFmt* pFmt = rFmts[i]; - if (aName == pFmt->GetSection()->GetSectionName()) + if (rName == pFmt->GetSection()->GetSectionName()) { bRet = sal_True; break; @@ -1565,7 +1564,7 @@ sal_Bool SwXTextSections::hasByName(const OUString& Name) else { //Sonderbehandlung der dbg_ - Methoden - if( COMPARE_EQUAL != aName.CompareToAscii("dbg_", 4)) + if( !rName.startsWith("dbg_")) throw uno::RuntimeException(); } return bRet; diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index 5b4c1156fe82..712dfab99a31 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -29,7 +29,6 @@ #include <algorithm> #include <tools/solar.h> // UINTXX #include <tools/stream.hxx> -#include <tools/string.hxx> #include "rtl/ustring.hxx" #include "hash_wrap.hxx" #include "sortedarray.hxx" diff --git a/tools/source/string/strascii.cxx b/tools/source/string/strascii.cxx deleted file mode 100644 index 85cca277286f..000000000000 --- a/tools/source/string/strascii.cxx +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifdef DBG_UTIL -static sal_Bool ImplDbgCheckAsciiStr( const sal_Char* pAsciiStr, sal_Int32 nLen ) -{ - while ( nLen && *pAsciiStr ) - { - if ( ((unsigned char)*pAsciiStr) > 127 ) - return sal_False; - ++pAsciiStr, - --nLen; - } - - return sal_True; -} -#endif - -static sal_Int32 ImplStringCompareAscii( const sal_Unicode* pStr1, const sal_Char* pStr2, - xub_StrLen nCount ) -{ - sal_Int32 nRet = 0; - while ( nCount && - ((nRet = ((sal_Int32)*pStr1)-((sal_Int32)((unsigned char)*pStr2))) == 0) && - *pStr2 ) - { - ++pStr1, - ++pStr2, - --nCount; - } - - return nRet; -} - -StringCompare UniString::CompareToAscii( const sal_Char* pAsciiStr, - xub_StrLen nLen ) const -{ - DBG_CHKTHIS( UniString, DbgCheckUniString ); - DBG_ASSERT( ImplDbgCheckAsciiStr( pAsciiStr, nLen ), - "UniString::CompareToAscii() - pAsciiStr include characters > 127" ); - - // String vergleichen - sal_Int32 nCompare = ImplStringCompareAscii( mpData->maStr, pAsciiStr, nLen ); - - // Rueckgabewert anpassen - if ( nCompare == 0 ) - return COMPARE_EQUAL; - else if ( nCompare < 0 ) - return COMPARE_LESS; - else - return COMPARE_GREATER; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx index 69af7a1f9e05..1463a3b50c0c 100644 --- a/tools/source/string/tustring.cxx +++ b/tools/source/string/tustring.cxx @@ -48,7 +48,6 @@ DBG_NAME( UniString ) #include <strimp.cxx> #include <strucvt.cxx> -#include <strascii.cxx> UniString::UniString(char c): mpData(ImplAllocData(1)) { mpData->maStr[0] = c; } |