diff options
author | Alexander Wilms <f.alexander.wilms@gmail.com> | 2014-02-22 21:20:15 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-23 03:38:49 +0000 |
commit | 0ce0c369aa8880dff9fe874ba85ec6f52ee37ddf (patch) | |
tree | 5024cba9f9ea5e3b23ea26025323f6aef39488d0 /i18npool | |
parent | b81ac16e65b311d6e43c05c22c65d2040c9d7e04 (diff) |
Remove unneccessary comments
Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb
Reviewed-on: https://gerrit.libreoffice.org/8182
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx | 2 | ||||
-rw-r--r-- | i18npool/source/localedata/filewriter.cxx | 4 | ||||
-rw-r--r-- | i18npool/source/localedata/localedata.cxx | 2 | ||||
-rw-r--r-- | i18npool/source/localedata/saxparser.cxx | 8 | ||||
-rw-r--r-- | i18npool/source/registerservices/registerservices.cxx | 2 | ||||
-rw-r--r-- | i18npool/source/search/levdis.cxx | 68 | ||||
-rw-r--r-- | i18npool/source/search/textsearch.cxx | 6 |
7 files changed, 37 insertions, 55 deletions
diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index 9afb85cc8960..86034d5f531d 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -547,7 +547,7 @@ DefaultNumberingProvider::makeNumberingString( const Sequence<beans::PropertyVal { // the Sequence of PropertyValues is expected to have at least 4 elements: // elt Name Type purpose - // ----------------------------------------------------------------- + // // 0. "Prefix" OUString // 1. "NumberingType" sal_Int16 type of formatting from style::NumberingType (roman, arabic, etc) diff --git a/i18npool/source/localedata/filewriter.cxx b/i18npool/source/localedata/filewriter.cxx index 7a9505a51c92..53be916c9c0e 100644 --- a/i18npool/source/localedata/filewriter.cxx +++ b/i18npool/source/localedata/filewriter.cxx @@ -20,10 +20,10 @@ #include <stdio.h> #include <string.h> #include "LocaleNode.hxx" -//----------------------------------------- + // The document handler, which is needed for the saxparser // The Documenthandler for reading sax -//----------------------------------------- + OFileWriter::OFileWriter(const char *pcFile, const char *locale ) { strncpy( m_pcFile , pcFile, sizeof(m_pcFile) ); diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index e0a1bc91bafe..f443141eb729 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -1346,7 +1346,7 @@ LocaleDataImpl::getContinuousNumberingLevels( const lang::Locale& rLocale ) thro namespace com{ namespace sun{ namespace star{ namespace lang { struct Locale; }}}} -//----------------------------------------------------------------------------- + struct OutlineNumberingLevel_Impl { OUString sPrefix; diff --git a/i18npool/source/localedata/saxparser.cxx b/i18npool/source/localedata/saxparser.cxx index c9ccc13f3719..2997d312f1e7 100644 --- a/i18npool/source/localedata/saxparser.cxx +++ b/i18npool/source/localedata/saxparser.cxx @@ -105,9 +105,9 @@ public: Sequence< sal_Int8> m_seq; }; -//------------------------------- + // Helper : create an input stream from a file -//------------------------------ + Reference< XInputStream > createStreamFromFile( const char *pcFile ) { @@ -329,10 +329,10 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) Reference< XComponentContext > xContext( defaultBootstrap_InitialComponentContext()); - //-------------------------------- + // parser demo // read xml from a file and count elements - //-------------------------------- + Reference< XParser > rParser = Parser::create(xContext); int nError = 0; diff --git a/i18npool/source/registerservices/registerservices.cxx b/i18npool/source/registerservices/registerservices.cxx index d0e576f2c654..93b38d72a0df 100644 --- a/i18npool/source/registerservices/registerservices.cxx +++ b/i18npool/source/registerservices/registerservices.cxx @@ -94,7 +94,7 @@ typedef uno::Reference< TRLT_IMPLNAME_PREFIX #implName, \ &implName##_CreateInstance } -// ------------------------------------------------------------------------------------- + using namespace i18n; diff --git a/i18npool/source/search/levdis.cxx b/i18npool/source/search/levdis.cxx index 90399d333f18..12ba7a1a100d 100644 --- a/i18npool/source/search/levdis.cxx +++ b/i18npool/source/search/levdis.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -/************************************************************************* +/* Weighted Levenshtein Distance including wildcards @@ -53,9 +53,7 @@ See also: German computer magazine c't 07/89 pages 192-208 and c't 03/94 pages 230-239 - -*************************************************************************/ - +*/ #include <string.h> @@ -69,7 +67,7 @@ #undef min #endif -#define LEVDISBIG (nLimit + 1) // Returnwert wenn Distanz > nLimit +#define LEVDISBIG (nLimit + 1) // Return value if distance > nLimit #define LEVDISDOUBLEBUF 2048 // dadrueber wird nicht mehr gedoppelt // Balance, aus Geschwindigkeitsgruenden ist dieses keine Funktion @@ -109,11 +107,11 @@ static sal_Int32 Impl_WLD_StringLen( const sal_Unicode* pStr ) return (sal_Int32)(pTempStr-pStr); } -// Distanz von String zu Pattern +// Distance from string to pattern int WLevDistance::WLD( const sal_Unicode* cString, sal_Int32 nStringLen ) { - int nSPMin = 0; // StrafPunkteMinimum - int nRepS = 0; // fuer SplitCount + int nSPMin = 0; // penalty point Minimum + int nRepS = 0; // for SplitCount // Laengendifferenz von Pattern und String int nLenDiff = nPatternLen - nStars - nStringLen; @@ -163,7 +161,7 @@ int WLevDistance::WLD( const sal_Unicode* cString, sal_Int32 nStringLen ) npDistance[0] = nInsQ0; // mit einfachem Einfuegen geht's los npDistance[1] = nInsQ0; npDistance[2] = nInsQ0; - int nReplacePos = -1; // tristate Flag + int nReplacePos = -1; // tristate flag int nDelCnt = 0; for ( sal_Int32 i=1; i <= nStringLen; i++, nDelCnt += nDelR0 ) { @@ -232,7 +230,7 @@ int WLevDistance::WLD( const sal_Unicode* cString, sal_Int32 nStringLen ) nPij = 0; // p(i,j) if ( nReplacePos < 0 ) { - int nBalance = 0; // gleiche Anzahl c + int nBalance = 0; // same quantity c LEVDISBALANCE( j, i-1 ); if ( !nBalance ) nReplacePos = 0; // keine Ersetzung mehr @@ -249,7 +247,7 @@ int WLevDistance::WLD( const sal_Unicode* cString, sal_Int32 nStringLen ) if ( bSplitCount ) { if ( nReplacePos < 0 && nPij && npDistance[i] == d1 + nPij ) - { // diese Stelle wird ersetzt + { // this poition will be replaced nRepS++; nReplacePos = i; } @@ -261,7 +259,7 @@ int WLevDistance::WLD( const sal_Unicode* cString, sal_Int32 nStringLen ) // Replace keins. Buchstabendreher werden hier erfasst // und der ReplaceS zurueckgenommen, wodurch das doppelte // Limit zum Tragen kommt. - int nBalance = 0; // gleiche Anzahl c + int nBalance = 0; // same quantity c LEVDISBALANCE( j, i-1 ); if ( !nBalance ) { // einer wurde ersetzt, der ein Insert war @@ -279,7 +277,7 @@ int WLevDistance::WLD( const sal_Unicode* cString, sal_Int32 nStringLen ) if ( bSplitCount ) { if ( nRepS && nLenDiff > 0 ) - nRepS -= nLenDiff; // Inserts wurden mitgezaehlt + nRepS -= nLenDiff; // Inserts were counted if ( (nSPMin <= 2 * nLimit) && (npDistance[nStringLen] <= 2 * nLimit) && (nRepS * nRepP0 <= nLimit) ) @@ -290,25 +288,23 @@ int WLevDistance::WLD( const sal_Unicode* cString, sal_Int32 nStringLen ) } } - - -// Berechnung von nLimit, nReplP0, nInsQ0, nDelR0, bSplitCount -// aus Userwerten nOtherX, nShorterY, nLongerZ, bRelaxed +// Calculating nLimit, nReplP0, nInsQ0, nDelR0, bSplitCount +// from user values nOtherX, nShorterY, nLongerZ, bRelaxed int WLevDistance::CalcLPQR( int nX, int nY, int nZ, bool bRelaxed ) { - if ( nX < 0 ) nX = 0; // nur positive Werte + if ( nX < 0 ) nX = 0; // only positive values if ( nY < 0 ) nY = 0; if ( nZ < 0 ) nZ = 0; - if (0 == Min3( nX, nY, nZ )) // mindestens einer 0 + if (0 == Min3( nX, nY, nZ )) // at least one 0 { int nMid, nMax; - nMax = Max3( nX, nY, nZ ); // entweder 0 bei drei 0 oder Max - if ( 0 == (nMid = Mid3( nX, nY, nZ )) ) // sogar zwei 0 - nLimit = nMax; // entweder 0 oder einziger >0 - else // einer 0 + nMax = Max3( nX, nY, nZ ); // either 0 for three 0s or Max + if ( 0 == (nMid = Mid3( nX, nY, nZ )) ) // even two 0 + nLimit = nMax; // either 0 or the only one >0 + else // one is 0 nLimit = KGV( nMid, nMax ); } - else // alle drei nicht 0 + else // all three of them are not 0 nLimit = KGV( KGV( nX, nY ), nZ ); nRepP0 = ( nX ? nLimit / nX : nLimit + 1 ); nInsQ0 = ( nY ? nLimit / nY : nLimit + 1 ); @@ -317,8 +313,6 @@ int WLevDistance::CalcLPQR( int nX, int nY, int nZ, bool bRelaxed ) return( nLimit ); } - - // Groesster Gemeinsamer Teiler nach Euklid (Kettendivision) // Sonderfall: 0 und irgendwas geben 1 int WLevDistance::GGT( int a, int b ) @@ -337,8 +331,6 @@ int WLevDistance::GGT( int a, int b ) return( a ? a : b); } - - // Kleinstes Gemeinsames Vielfaches: a * b / GGT(a,b) int WLevDistance::KGV( int a, int b ) { @@ -348,8 +340,7 @@ int WLevDistance::KGV( int a, int b ) return( (b / GGT(a,b)) * a ); } - -// Minimum von drei Werten +// Minimum of three values inline int WLevDistance::Min3( int x, int y, int z ) { if ( x < y ) @@ -358,9 +349,7 @@ inline int WLevDistance::Min3( int x, int y, int z ) return( y < z ? y : z ); } - - -// mittlerer von drei Werten +// The value in the middle int WLevDistance::Mid3( int x, int y, int z ) { int min = Min3(x,y,z); @@ -372,9 +361,7 @@ int WLevDistance::Mid3( int x, int y, int z ) return( x < y ? x : y); } - - -// Maximum von drei Werten +// Maximum of three values int WLevDistance::Max3( int x, int y, int z ) { if ( x > y ) @@ -383,8 +370,6 @@ int WLevDistance::Max3( int x, int y, int z ) return( y > z ? y : z ); } - - // Daten aus CTor initialisieren void WLevDistance::InitData( const sal_Unicode* cPattern ) { @@ -395,12 +380,12 @@ void WLevDistance::InitData( const sal_Unicode* cPattern ) const sal_Unicode* cp1 = cPattern; sal_Unicode* cp2 = cpPattern; bool* bp = bpPatIsWild; - // Pattern kopieren, Sternchen zaehlen, escaped Jokers + // copy pattern, count asterisks, escaped Jokers while ( *cp1 ) { if ( *cp1 == '\\' ) // maybe escaped { - if ( *(cp1+1) == '*' || *(cp1+1) == '?' ) // naechstes Joker? + if ( *(cp1+1) == '*' || *(cp1+1) == '?' ) // next Joker? { cp1++; // skip '\\' nPatternLen--; @@ -420,7 +405,6 @@ void WLevDistance::InitData( const sal_Unicode* cPattern ) *cp2 = '\0'; } - WLevDistance::WLevDistance( const sal_Unicode* cPattern, int nOtherX, int nShorterY, int nLongerZ, bool bRelaxed ) : @@ -433,7 +417,6 @@ WLevDistance::WLevDistance( const sal_Unicode* cPattern, CalcLPQR( nOtherX, nShorterY, nLongerZ, bRelaxed ); } - // CopyCTor WLevDistance::WLevDistance( const WLevDistance& rWLD ) : nPatternLen( rWLD.nPatternLen ), @@ -459,7 +442,6 @@ WLevDistance::WLevDistance( const WLevDistance& rWLD ) : cpPattern[i] = '\0'; } - // DTor WLevDistance::~WLevDistance() { diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx index 62e38d775736..c5ac12add07b 100644 --- a/i18npool/source/search/textsearch.cxx +++ b/i18npool/source/search/textsearch.cxx @@ -424,7 +424,7 @@ SearchResult TextSearch::searchBackward( const OUString& searchStr, sal_Int32 st return sres; } -//--------------------------------------------------------------------- + bool TextSearch::IsDelimiter( const OUString& rStr, sal_Int32 nPos ) const { @@ -792,7 +792,7 @@ void TextSearch::RESrchPrepare( const ::com::sun::star::util::SearchOptions& rOp } } -//--------------------------------------------------------------------------- + static bool lcl_findRegex( RegexMatcher * pRegexMatcher, sal_Int32 nStartPos, UErrorCode & rIcuErr ) { @@ -932,7 +932,7 @@ SearchResult TextSearch::RESrchBkwrd( const OUString& searchStr, return aRet; } -//--------------------------------------------------------------------------- + // search for words phonetically SearchResult TextSearch::ApproxSrchFrwrd( const OUString& searchStr, |