[Libreoffice-commits] .: 3 commits - basic/inc basic/source editeng/source sw/source
basic/inc/basic/sbx.hxx |6 +++--- basic/source/sbx/sbxbase.cxx | 29 - basic/source/sbx/sbxvar.cxx | 19 +-- editeng/source/editeng/eeng_pch.hxx |1 - editeng/source/editeng/impedit.hxx |6 +- editeng/source/editeng/impedit2.cxx | 16 +--- editeng/source/outliner/outleeng.hxx |3 +-- editeng/source/outliner/outliner.cxx | 18 +- sw/source/core/edit/acorrect.cxx |3 --- 9 files changed, 36 insertions(+), 65 deletions(-) New commits: commit 3447718347c6ffe4135fb3d3faeff367401e25f4 Author: August Sodora aug...@gmail.com Date: Sat Jan 14 15:11:10 2012 -0500 SV_DECL_PTRARR_DEL-std::vector diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index c05b83e..39107a4 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -78,10 +78,6 @@ DBG_NAMEEX( EditEngine ) #define LINE_SEP0x0A -typedef EENotify* EENotifyPtr; -SV_DECL_PTRARR_DEL( NotifyList, EENotifyPtr, 1, 1 )// IMPL is in outliner.cxx, move to EE later and share declaration, or use BlockNotifications from EE directly - - class EditView; class EditEngine; class SvxFontTable; @@ -440,7 +436,7 @@ private: ImplIMEInfos* mpIMEInfos; -NotifyList aNotifyCache; +std::vectorEENotify aNotifyCache; XubString aWordDelimiters; XubString aGroupChars; diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index b344b3a..a53c670 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -4383,14 +4383,9 @@ sal_Bool ImpEditEngine::DoVisualCursorTraveling( const ContentNode* ) void ImpEditEngine::CallNotify( EENotify rNotify ) { if ( !nBlockNotifications ) -{ GetNotifyHdl().Call( rNotify ); -} else -{ -EENotify* pNewNotify = new EENotify( rNotify ); -aNotifyCache.Insert( pNewNotify, aNotifyCache.Count() ); -} +aNotifyCache.push_back(rNotify); } void ImpEditEngine::EnterBlockNotifications() @@ -4416,13 +4411,12 @@ void ImpEditEngine::LeaveBlockNotifications() if ( !nBlockNotifications ) { // Call blocked notify events... -while ( aNotifyCache.Count() ) +while(!aNotifyCache.empty()) { -EENotify* pNotify = aNotifyCache[0]; +EENotify aNotify(aNotifyCache[0]); // Remove from list before calling, maybe we enter LeaveBlockNotifications while calling the handler... -aNotifyCache.Remove( 0 ); -GetNotifyHdl().Call( pNotify ); -delete pNotify; +aNotifyCache.erase(aNotifyCache.begin()); +GetNotifyHdl().Call( aNotify ); } EENotify aNotify( EE_NOTIFY_BLOCKNOTIFICATION_END ); diff --git a/editeng/source/outliner/outleeng.hxx b/editeng/source/outliner/outleeng.hxx index 59124b8..14051c3 100644 --- a/editeng/source/outliner/outleeng.hxx +++ b/editeng/source/outliner/outleeng.hxx @@ -31,8 +31,7 @@ #include editeng/outliner.hxx #include editeng/editeng.hxx -typedef EENotify* EENotifyPtr; -SV_DECL_PTRARR_DEL( NotifyList, EENotifyPtr, 1, 1 ) +typedef std::vectorEENotify NotifyList; class OutlinerEditEng : public EditEngine { diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 37a569e..f62cec6 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2039,8 +2039,6 @@ void Outliner::SetLevelDependendStyleSheet( sal_uInt16 nPara ) pEditEngine-SetParaAttribs( nPara, aOldAttrs ); } -SV_IMPL_PTRARR( NotifyList, EENotifyPtr ); - void Outliner::ImplBlockInsertionCallbacks( sal_Bool b ) { if ( b ) @@ -2054,13 +2052,12 @@ void Outliner::ImplBlockInsertionCallbacks( sal_Bool b ) if ( !bBlockInsCallback ) { // Call blocked notify events... -while ( pEditEngine-aNotifyCache.Count() ) +while(!pEditEngine-aNotifyCache.empty()) { -EENotify* pNotify = pEditEngine-aNotifyCache[0]; +EENotify aNotify(pEditEngine-aNotifyCache.front()); // Remove from list before calling, maybe we enter LeaveBlockNotifications while calling the handler... -pEditEngine-aNotifyCache.Remove( 0 ); -pEditEngine-aOutlinerNotifyHdl.Call( pNotify ); -delete pNotify; + pEditEngine-aNotifyCache.erase(pEditEngine-aNotifyCache.begin()); +pEditEngine-aOutlinerNotifyHdl.Call( aNotify ); } } } @@ -2069,14 +2066,9 @@ void Outliner::ImplBlockInsertionCallbacks( sal_Bool b ) IMPL_LINK( Outliner, EditEngineNotifyHdl, EENotify*, pNotify ) { if ( !bBlockInsCallback ) -{ pEditEngine-aOutlinerNotifyHdl.Call( pNotify ); -
[Libreoffice-commits] .: 3 commits - basic/inc basic/source
basic/inc/basrid.hxx |6 --- basic/source/comp/scanner.cxx | 79 -- basic/source/inc/scanner.hxx |1 3 files changed, 47 insertions(+), 39 deletions(-) New commits: commit d3a52bd7b3fe11fc6cf5f3296dd00eba524e40a0 Author: August Sodora aug...@gmail.com Date: Sat Jan 7 18:32:47 2012 -0500 scanner cleanup for consistency diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx index 7eb6fb0..25a493a 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -162,18 +162,18 @@ void SbiScanner::scanAlphanumeric() void SbiScanner::scanGoto() { -sal_Int32 nTestCol = nCol; -while(nTestCol aLine.getLength() theBasicCharClass::get().isWhitespace(aLine[nTestCol])) -nTestCol++; +sal_Int32 n = nCol; +while(n aLine.getLength() theBasicCharClass::get().isWhitespace(aLine[n])) +++n; -if(nTestCol + 1 aLine.getLength()) +if(n + 1 aLine.getLength()) { -::rtl::OUString aTestSym = aLine.copy(nTestCol, 2); - if(aTestSym.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM(to))) +::rtl::OUString aTemp = aLine.copy(n, 2); +if(aTemp.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM(to))) { aSym = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(goto)); -pLine += nTestCol + 2 - nCol; -nCol = nTestCol + 2; +pLine += n + 2 - nCol; +nCol = n + 2; } } } commit 1e04280bce397f6c4c6715ab882fa9fd8f372c09 Author: August Sodora aug...@gmail.com Date: Sat Jan 7 18:23:45 2012 -0500 Refactor readLine in scanner diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx index 1c49f98..7eb6fb0 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -178,6 +178,40 @@ void SbiScanner::scanGoto() } } +bool SbiScanner::readLine() +{ +if(nBufPos = aBuf.getLength()) +return false; + +sal_Int32 n = nBufPos; +sal_Int32 nLen = aBuf.getLength(); + +while(n nLen aBuf[n] != '\r' aBuf[n] != '\n') +++n; + +// Trim trailing whitespace +sal_Int32 nEnd = n; +while(nBufPos nEnd theBasicCharClass::get().isWhitespace(aBuf[nEnd - 1])) +--nEnd; + +aLine = aBuf.copy(nBufPos, nEnd - nBufPos); + +// Fast-forward past the line ending +if(n + 1 nLen aBuf[n] == '\r' aBuf[n + 1] == '\n') +n += 2; +else if(n nLen) +n++; + +nBufPos = n; +pLine = aLine.getStr(); + +++nLine; +nCol = nCol1 = nCol2 = 0; +nColLock = 0; + +return true; +} + bool SbiScanner::NextSym() { // memorize for the EOLN-case @@ -195,33 +229,12 @@ bool SbiScanner::NextSym() // read in line? if( !pLine ) { -sal_Int32 n = nBufPos; -sal_Int32 nLen = aBuf.getLength(); -if( nBufPos = nLen ) +if(!readLine()) return false; -const sal_Unicode* p2 = aBuf.getStr(); -p2 += n; -while( ( n nLen ) ( *p2 != '\n' ) ( *p2 != '\r' ) ) -p2++, n++; -// #163944# ignore trailing whitespace -sal_Int32 nCopyEndPos = n; -while( (nBufPos nCopyEndPos) theBasicCharClass::get().isWhitespace( aBuf[ nCopyEndPos - 1 ] ) ) ---nCopyEndPos; -aLine = aBuf.copy( nBufPos, nCopyEndPos - nBufPos ); -if( n nLen ) -{ -if( *p2 == '\r' *( p2+1 ) == '\n' ) -n += 2; -else -n++; -} -nBufPos = n; -pLine = aLine.getStr(); -nOldLine = ++nLine; -nCol = nCol1 = nCol2 = nOldCol1 = nOldCol2 = 0; -nColLock = 0; -} +nOldLine = nLine; +nOldCol1 = nOldCol2 = 0; +} while( theBasicCharClass::get().isWhitespace( *pLine ) ) pLine++, nCol++, bSpaces = true; diff --git a/basic/source/inc/scanner.hxx b/basic/source/inc/scanner.hxx index 96b0658..69c3d87 100644 --- a/basic/source/inc/scanner.hxx +++ b/basic/source/inc/scanner.hxx @@ -48,6 +48,7 @@ class SbiScanner void scanAlphanumeric(); void scanGoto(); +bool readLine(); protected: ::rtl::OUString aSym; String aError; commit db1faf486837c44a69406a53ea67f66a6fe56d34 Author: August Sodora aug...@gmail.com Date: Sat Jan 7 17:50:21 2012 -0500 Remove unused class SttResId diff --git a/basic/inc/basrid.hxx b/basic/inc/basrid.hxx index f79778c..ecb55fc 100644 --- a/basic/inc/basrid.hxx +++ b/basic/inc/basrid.hxx @@ -31,12 +31,6 @@ #include tools/resid.hxx -class SttResId : public ResId -{ -public: -SttResId( sal_uInt32 nId ); -}; - class BasResId : public ResId { public: ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 3 commits - basic/inc basic/source
basic/inc/basic/basicrt.hxx |8 basic/source/sbx/sbxcurr.cxx |9 + basic/source/sbx/sbxvalue.cxx |7 +++ 3 files changed, 20 insertions(+), 4 deletions(-) New commits: commit 8529da08517b41bd9317714e3216bb6d487b24ee Author: Tor Lillqvist tlillqv...@suse.com Date: Thu Oct 6 10:12:47 2011 +0300 WaE: unreachable code diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index 8b55561..7ca1d9c 100644 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -1311,9 +1311,16 @@ Lbl_OpIsDouble: else aL.nDouble /= aR.nDouble; break; case SbxPLUS: aL.nDouble += aR.nDouble; break; +#if 0 +// See 'break' on preceding line... this +// is unreachable code. Do not delete this +// #if 0 block unless you know for sure +// the 'break' above is intentional. + // #45465 Date needs with + a special handling: forces date type if( GetType() == SbxDATE || rOp.GetType() == SbxDATE ) aL.eType = SbxDATE; +#endif case SbxMINUS: aL.nDouble -= aR.nDouble; break; case SbxNEG: commit ba491984f49ca29bcfe0515145bcef0c12189270 Author: Tor Lillqvist tlillqv...@suse.com Date: Thu Oct 6 10:08:06 2011 +0300 WaE: inconsistent dll linkage basicrt goes into the static app library, so DLL import/export decorations meaningless. diff --git a/basic/inc/basic/basicrt.hxx b/basic/inc/basic/basicrt.hxx index 981fe18..4e6b4de 100644 --- a/basic/inc/basic/basicrt.hxx +++ b/basic/inc/basic/basicrt.hxx @@ -40,9 +40,9 @@ class BasicRuntime SbiRuntime* pRun; public: BasicRuntime( SbiRuntime* p ) : pRun ( p ){;} -BASIC_DLLPUBLIC const String GetSourceRevision(); -BASIC_DLLPUBLIC const String GetModuleName( SbxNameType nType ); -BASIC_DLLPUBLIC const String GetMethodName( SbxNameType nType ); +const String GetSourceRevision(); +const String GetModuleName( SbxNameType nType ); +const String GetMethodName( SbxNameType nType ); xub_StrLen GetLine(); xub_StrLen GetCol1(); xub_StrLen GetCol2(); @@ -64,7 +64,7 @@ public: xub_StrLen GetCol2(); }; -class BASIC_DLLPUBLIC BasicRuntimeAccess +class BasicRuntimeAccess { public: static BasicRuntime GetRuntime(); commit cce8278ebaf333024b867d9b68d3feb70235f1dc Author: Tor Lillqvist tlillqv...@suse.com Date: Thu Oct 6 09:36:07 2011 +0300 WaE: unreachable code diff --git a/basic/source/sbx/sbxcurr.cxx b/basic/source/sbx/sbxcurr.cxx index 574c804..c227681 100644 --- a/basic/source/sbx/sbxcurr.cxx +++ b/basic/source/sbx/sbxcurr.cxx @@ -268,13 +268,21 @@ start: case SbxSALINT64: { nRes = p-nInt64 * CURRENCY_FACTOR; break; +#if 0 +// Huh, is the 'break' above intentional? That means this +// is unreachable, obviously. Avoid warning by ifdeffing +// this out for now. Do not delete this #if 0 block unless +// you know for sure the 'break' above is intentional. if ( nRes SbxMAXSALINT64 ) { SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXSALINT64; } +#endif } case SbxSALUINT64: nRes = p-nInt64 * CURRENCY_FACTOR; break; +#if 0 +// As above if ( nRes SbxMAXSALINT64 ) { SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXSALINT64; @@ -284,6 +292,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMINSALINT64; } break; +#endif //TODO: bring back SbxINT64 types here for limits -1 with flag value at SAL_MAX/MIN case SbxSINGLE: if( p-nSingle * CURRENCY_FACTOR + 0.5 (float)SAL_MAX_INT64 ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits