cui/source/options/optsave.cxx | 27 +++++++++++-------- include/svx/fillctrl.hxx | 2 - include/tools/string.hxx | 9 +++--- readlicense_oo/docs/readme.xrm | 4 +- sc/source/core/opencl/formulagroupcl.cxx | 2 - sc/source/core/opencl/openclwrapper.cxx | 2 - sc/source/filter/html/htmlexp.cxx | 1 sc/source/filter/inc/namebuff.hxx | 16 ++++++----- svx/source/tbxctrls/fillctrl.cxx | 13 --------- sw/source/core/edit/edattr.cxx | 10 ++++++- sw/source/core/text/itrcrsr.cxx | 10 ++++++- sw/source/core/text/txtfrm.cxx | 10 ++++++- tools/source/string/strimp.cxx | 29 --------------------- tools/source/string/tustring.cxx | 42 ------------------------------- unusedcode.easy | 2 - 15 files changed, 62 insertions(+), 117 deletions(-)
New commits: commit f9768de91e1d6e6c58cf8c09dd1a4dc23877c2ba Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 16 10:31:02 2013 +0100 CID#1103764 uninitialized scalar field Change-Id: I828ab50e11546ba5f183e27dbff8ba87827bb426 diff --git a/sc/source/filter/inc/namebuff.hxx b/sc/source/filter/inc/namebuff.hxx index bb27605..8c6c878 100644 --- a/sc/source/filter/inc/namebuff.hxx +++ b/sc/source/filter/inc/namebuff.hxx @@ -172,22 +172,24 @@ class RangeNameBufferWK3 { private: struct Entry - { + { StringHashEntry aStrHashEntry; ScComplexRefData aScComplexRefDataRel; OUString aScAbsName; sal_uInt16 nAbsInd; // == 0 -> noch keine Abs-Name! sal_uInt16 nRelInd; sal_Bool bSingleRef; - Entry( const OUString& rName, const OUString& rScName, const ScComplexRefData& rCRD ) : - aStrHashEntry( rName ), - aScComplexRefDataRel( rCRD ), - aScAbsName( rScName ) + Entry( const OUString& rName, const OUString& rScName, const ScComplexRefData& rCRD ) + : aStrHashEntry( rName ) + , aScComplexRefDataRel( rCRD ) + , aScAbsName( rScName ) + , nAbsInd(0) + , nRelInd(0) + , bSingleRef(false) { - nAbsInd = 0; aScAbsName = "_ABS"; } - }; + }; ScTokenArray* pScTokenArray; sal_uInt16 nIntCount; commit d70b46c163c9cf147fdf6aed1aa14fbde2fd2049 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 16 10:28:46 2013 +0100 CID#1103768 uninitialized scalar field Change-Id: I05ce7f66ca76345eabb660a12d9cd85a34ef55dd diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index e161e0d..c14bd66 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -219,6 +219,7 @@ ScHTMLExport::ScHTMLExport( SvStream& rStrmP, const OUString& rBaseURL, ScDocume nIndent( 0 ), bAll( bAllP ), bTabHasGraphics( false ), + bTabAlignedLeft( false ), bCalcAsShown( pDocP->GetDocOptions().IsCalcAsShown() ), bTableDataWidth( sal_True ), bTableDataHeight( sal_True ) commit 9ad3316530c1bf55b6864013d7e4fb539eaef296 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 16 09:45:18 2013 +0100 CID#736195 out of bounds Change-Id: I9a644a52146eb33248762c65c71fbd9a187490b7 diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index ec89c9f..3ee2bc8 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -2184,8 +2184,16 @@ void SwTxtFrm::CalcAdditionalFirstLineOffset() if ( pTxtNode && pTxtNode->IsNumbered() && pTxtNode->IsCountedInList() && pTxtNode->GetNumRule() ) { + int nListLevel = pTxtNode->GetActualListLevel(); + + if (nListLevel < 0) + nListLevel = 0; + + if (nListLevel >= MAXLEVEL) + nListLevel = MAXLEVEL - 1; + const SwNumFmt& rNumFmt = - pTxtNode->GetNumRule()->Get( static_cast<sal_uInt16>(pTxtNode->GetActualListLevel()) ); + pTxtNode->GetNumRule()->Get( static_cast<sal_uInt16>(nListLevel) ); if ( rNumFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT ) { // keep current paragraph portion and apply dummy paragraph portion commit 8df4f86d27df14d22eec4894aba86e551ea9c4a1 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 16 09:41:23 2013 +0100 CID#982804 out of bounds Change-Id: I134944d8c4a1312f65ff7c3df98d8828bfc96b15 diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx index 4306fb5..ded5702 100644 --- a/sw/source/core/edit/edattr.cxx +++ b/sw/source/core/edit/edattr.cxx @@ -464,7 +464,15 @@ static bool lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos, const SwNumRule* pNumRule = rTNd.GetNumRule(); if(pNumRule) { - const SwNumFmt &rNumFmt = pNumRule->Get( static_cast<sal_uInt16>(rTNd.GetActualListLevel()) ); + int nListLevel = rTNd.GetActualListLevel(); + + if (nListLevel < 0) + nListLevel = 0; + + if (nListLevel >= MAXLEVEL) + nListLevel = MAXLEVEL - 1; + + const SwNumFmt &rNumFmt = pNumRule->Get( static_cast<sal_uInt16>(nListLevel) ); if( SVX_NUM_BITMAP != rNumFmt.GetNumberingType() ) { if ( SVX_NUM_CHAR_SPECIAL == rNumFmt.GetNumberingType() ) commit 557de68e965a5d1b0fb56270d5c5f46ebb9cd0fc Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 16 09:39:19 2013 +0100 CID#982805 out of bounds Change-Id: I58b6a1738c2039e863f1446cbfa17d1138523694 diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index 1e981892..fa3fa08 100644 --- a/sw/source/core/text/itrcrsr.cxx +++ b/sw/source/core/text/itrcrsr.cxx @@ -143,8 +143,16 @@ namespace { if ( rTxtNode.AreListLevelIndentsApplicable() ) { + int nListLevel = rTxtNode.GetActualListLevel(); + + if (nListLevel < 0) + nListLevel = 0; + + if (nListLevel >= MAXLEVEL) + nListLevel = MAXLEVEL - 1; + const SwNumFmt& rNumFmt = - rTxtNode.GetNumRule()->Get( static_cast<sal_uInt16>(rTxtNode.GetActualListLevel()) ); + rTxtNode.GetNumRule()->Get( static_cast<sal_uInt16>(nListLevel) ); if ( rNumFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT ) { bRet = true; commit 5d6fc7d3fb9652185b2528188d4d8f56c1a4aa9e Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 16 09:26:05 2013 +0100 CID#1103722 resource leak Change-Id: Ia08a0c8d4366bde572a7438ceff687f6028b066e diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 5d7d7fa..e7061d7 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -784,7 +784,6 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc, const ScAddress const std::vector<formula::VectorRefArray>& rArrays = pDvr->GetArrays(); uint rArraysSize = rArrays.size(); int nMoreColSize = 0; - DoubleVectorFormula *SvDoubleTemp = new DoubleVectorFormula(); nSrcDataSize = pDvr->GetArrayLength(); if( rArraysSize > 1 ) { @@ -804,6 +803,7 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc, const ScAddress else { dpOclSrcData = rArrays[0].mpNumericArray; + DoubleVectorFormula *SvDoubleTemp = new DoubleVectorFormula(); SvDoubleTemp->mdpInputData = dpOclSrcData; SvDoubleTemp->mnInputDataSize = nSrcDataSize; SvDoubleTemp->mnInputStartPosition = mnpOclStartPos[nCountNum*mnRowSize]; commit f4b293d5776101433131234daf6347076bbb458d Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 16 09:24:02 2013 +0100 CID#1103728 malloc(1) Change-Id: I89bbd213b7eddd5c55d4c8768929add326a63722 diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx index 77f802e..51bd4ff 100644 --- a/sc/source/core/opencl/openclwrapper.cxx +++ b/sc/source/core/opencl/openclwrapper.cxx @@ -2819,7 +2819,7 @@ bool switchOpenclDevice(const OUString* pDevice, bool bAutoSelect) OpenclDevice::initOpenclAttr(&env); // why do we need this at all? - OpenclDevice::gpuEnv.mpArryDevsID = (cl_device_id*) malloc( 1 ); + OpenclDevice::gpuEnv.mpArryDevsID = (cl_device_id*) malloc( sizeof(cl_device_id) ); OpenclDevice::gpuEnv.mpArryDevsID[0] = pDeviceId; return !OpenclDevice::initOpenclRunEnv(0); } commit 3c54ef67ac055af374a81e1a128ff1dab8617f7f Author: Ariel Constenla-Haile <arie...@apache.org> Date: Wed Oct 16 00:04:54 2013 +0000 Resolves: #i123481# - Paragraph should have a language to mark it localizable (cherry picked from commit 6f9694374143ce181353b44df1d9da78d7dd7cc1) Conflicts: readlicense_oo/docs/readme/readme.xrm Change-Id: Idfa47f97ad84ad5b3bb9414ee9e3b89e693501f6 diff --git a/readlicense_oo/docs/readme.xrm b/readlicense_oo/docs/readme.xrm index 4fd3135..e6c1f39 100755 --- a/readlicense_oo/docs/readme.xrm +++ b/readlicense_oo/docs/readme.xrm @@ -215,8 +215,8 @@ </div> <div id="ModifiedSourceCode"> - <h2 id="sdffd23r3cefwefew" xml:lang="en-US">Used / Modified Source Code</h2> - <p id="sdffd23red32efew">Portions Copyright 1998, 1999 James Clark. Portions Copyright 1996, 1998 Netscape Communications Corporation.</p> + <h2 id="ModifiedSourceCodeHeading" xml:lang="en-US">Used / Modified Source Code</h2> + <p id="ModifiedSourceCodePara" xml:lang="en-US">Portions Copyright 1998, 1999 James Clark. Portions Copyright 1996, 1998 Netscape Communications Corporation.</p> </div> </body> </html> commit 831e35610c91556567d5e0bc14a4125ebdc2ac35 Author: Ariel Constenla-Haile <arie...@apache.org> Date: Tue Oct 15 21:17:30 2013 +0000 Resolves: #i122759# Pass the Sequence by reference Despite it's name, rProperties, the Sequence is not a reference in the function signature. Besides, some small improvements: - instead of compareToAscii, use operator==, which is optimized for performance (cherry picked from commit a17e221225915c140c7840904cb9b46d75731edc) Conflicts: cui/source/options/optsave.cxx Change-Id: Ifffd2b9014210c885f03ff8116ea97625b903cba diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx index 31a164d..ce66f09 100644 --- a/cui/source/options/optsave.cxx +++ b/cui/source/options/optsave.cxx @@ -519,24 +519,29 @@ IMPL_LINK( SfxSaveTabPage, AutoClickHdl_Impl, CheckBox *, pBox ) return 0; } -static OUString lcl_ExtracUIName(const Sequence<PropertyValue> rProperties) +static OUString lcl_ExtracUIName(const Sequence<PropertyValue> &rProperties) { - OUString sRet; - const PropertyValue* pProperties = rProperties.getConstArray(); - for(int nProp = 0; nProp < rProperties.getLength(); nProp++) + OUString sName; + const PropertyValue* pPropVal = rProperties.getConstArray(); + const PropertyValue* const pEnd = pPropVal + rProperties.getLength(); + for( ; pPropVal != pEnd; pPropVal++ ) { - if(!pProperties[nProp].Name.compareToAscii("UIName")) + const OUString &rName = pPropVal->Name; + if (rName == "UIName") { - if ( pProperties[nProp].Value >>= sRet ) - break; + OUString sUIName; + if ( ( pPropVal->Value >>= sUIName ) && sUIName.getLength() ) + return sUIName; } - else if(!pProperties[nProp].Name.compareToAscii("Name")) + else if (rName == "Name") { - if ( !sRet.getLength() ) - pProperties[nProp].Value >>= sRet; + pPropVal->Value >>= sName; } } - return sRet; + + OSL_ENSURE( false, "Filter without UIName!" ); + + return sName; } IMPL_LINK( SfxSaveTabPage, FilterHdl_Impl, ListBox *, pBox ) commit 500822eeb46698c7317f57de72b2489d98042374 Author: Armin Le Grand <a...@apache.org> Date: Tue Oct 15 15:51:03 2013 +0000 Resolves: #i122738# corrected update of FillStyle/FillAttribute UI elements (cherry picked from commit 2fc5d2946561258b012b80443cac025d851afda8) Conflicts: svx/inc/svx/fillctrl.hxx svx/source/tbxctrls/fillctrl.cxx Change-Id: I3be23f7ec199c49beb7c5cecfb835977e2bedcea diff --git a/include/svx/fillctrl.hxx b/include/svx/fillctrl.hxx index 065321f..73d531b 100644 --- a/include/svx/fillctrl.hxx +++ b/include/svx/fillctrl.hxx @@ -54,7 +54,6 @@ private: SvxFillAttrBox* pFillAttrLB; sal_Bool bUpdate; - sal_Bool bIgnoreStatusUpdate; sal_uInt16 eLastXFS; public: @@ -67,7 +66,6 @@ public: const SfxPoolItem* pState ); void Update( const SfxPoolItem* pState ); virtual Window* CreateItemWindow( Window *pParent ); - void IgnoreStatusUpdate( sal_Bool bSet ); }; //======================================================================== diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx index 00f4078..99b2d9c 100644 --- a/svx/source/tbxctrls/fillctrl.cxx +++ b/svx/source/tbxctrls/fillctrl.cxx @@ -65,7 +65,6 @@ SvxFillToolBoxControl::SvxFillToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId pFillTypeLB ( NULL ), pFillAttrLB ( NULL ), bUpdate ( sal_False ), - bIgnoreStatusUpdate( sal_False ), eLastXFS ( XFILL_NONE ) { addStatusListener( OUString( ".uno:FillColor" )); @@ -97,9 +96,6 @@ void SvxFillToolBoxControl::StateChanged( { - if ( bIgnoreStatusUpdate ) - return; - if( eState == SFX_ITEM_DISABLED ) { if( nSID == SID_ATTR_FILL_STYLE ) @@ -220,13 +216,6 @@ void SvxFillToolBoxControl::StateChanged( //======================================================================== -void SvxFillToolBoxControl::IgnoreStatusUpdate( sal_Bool bSet ) -{ - bIgnoreStatusUpdate = bSet; -} - -//======================================================================== - void SvxFillToolBoxControl::Update( const SfxPoolItem* pState ) { if ( pStyleItem && pState && bUpdate ) @@ -670,10 +659,8 @@ IMPL_LINK( FillControl, SelectFillAttrHdl, ListBox *, pBox ) aArgs[0].Name = OUString( "FillStyle" ); aXFillStyleItem.QueryValue( a ); aArgs[0].Value = a; - ( (SvxFillToolBoxControl*)GetData() )->IgnoreStatusUpdate( sal_True ); ((SvxFillToolBoxControl*)GetData())->Dispatch( OUString( ".uno:FillStyle" ), aArgs ); - ( (SvxFillToolBoxControl*)GetData() )->IgnoreStatusUpdate( sal_False ); switch( eXFS ) { commit 255cfbbeaa090fd7a06130e2b621cb27ae9baca4 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 16 08:54:51 2013 +0100 Related: fdo#38838 remove unused String::Append varients Change-Id: I158c171d39756d1949427b3a45d685a194d9fb63 diff --git a/include/tools/string.hxx b/include/tools/string.hxx index 74288fbf..796971e 100644 --- a/include/tools/string.hxx +++ b/include/tools/string.hxx @@ -133,10 +133,15 @@ private: TOOLS_DLLPRIVATE UniString( const sal_Unicode* pCharStr, xub_StrLen nLen ); TOOLS_DLLPRIVATE UniString( sal_Unicode c ); TOOLS_DLLPRIVATE UniString& Assign( const sal_Unicode* pCharStr, xub_StrLen nLen ); + TOOLS_DLLPRIVATE UniString& Append( const sal_Unicode* pCharStr ); + TOOLS_DLLPRIVATE UniString& Append( const sal_Unicode* pCharStr, xub_StrLen nLen ); TOOLS_DLLPRIVATE UniString& Expand( xub_StrLen nCount, sal_Unicode cExpandChar ); TOOLS_DLLPRIVATE sal_Bool Equals( const sal_Unicode* pCharStr, xub_StrLen nIndex, xub_StrLen nLen ) const; TOOLS_DLLPRIVATE xub_StrLen Search( const sal_Unicode* pCharStr, xub_StrLen nIndex = 0 ) const; + + TOOLS_DLLPRIVATE UniString& operator +=( const sal_Unicode* pCharStr ); + public: UniString(); UniString( const ResId& rResId ); @@ -191,8 +196,6 @@ public: { return operator =(static_cast< sal_Unicode >(c)); } UniString& Append( const UniString& rStr ); - UniString& Append( const sal_Unicode* pCharStr ); - UniString& Append( const sal_Unicode* pCharStr, xub_StrLen nLen ); UniString& Append( sal_Unicode c ); inline UniString & Append(char c) // ...but allow "Append('a')" { return Append(static_cast< sal_Unicode >(c)); } @@ -200,8 +203,6 @@ public: { return Append( rStr ); } UniString& operator +=( const OUString& rStr ) { return Append( UniString(rStr) ); } - UniString& operator +=( const sal_Unicode* pCharStr ) - { return Append( pCharStr ); } UniString& operator +=( sal_Unicode c ) { return Append( c ); } inline UniString & operator +=(char c) // ...but allow "+= 'a'" diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx index b86564a..6b0c401 100644 --- a/tools/source/string/strimp.cxx +++ b/tools/source/string/strimp.cxx @@ -203,35 +203,6 @@ STRING& STRING::Append( const STRING& rStr ) return *this; } -STRING& STRING::Append( const STRCODE* pCharStr ) -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - DBG_ASSERT( pCharStr, "String::Append() - pCharStr is NULL" ); - - // determine string length - sal_Int32 nLen = mpData->mnLen; - sal_Int32 nCopyLen = ImplStringLen( pCharStr ); - - // detect overflow - nCopyLen = ImplGetCopyLen( nLen, nCopyLen ); - - if ( nCopyLen ) - { - // allocate string of new size - STRINGDATA* pNewData = ImplAllocData( nLen+nCopyLen ); - - // copy string - memcpy( pNewData->maStr, mpData->maStr, nLen*sizeof( STRCODE ) ); - memcpy( pNewData->maStr+nLen, pCharStr, nCopyLen*sizeof( STRCODE ) ); - - // free old string - STRING_RELEASE((STRING_TYPE *)mpData); - mpData = pNewData; - } - - return *this; -} - void STRING::SetChar( xub_StrLen nIndex, STRCODE c ) { DBG_CHKTHIS( STRING, DBGCHECKSTRING ); diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx index c339941..69af7a1 100644 --- a/tools/source/string/tustring.cxx +++ b/tools/source/string/tustring.cxx @@ -282,48 +282,6 @@ STRING STRING::GetToken( xub_StrLen nToken, STRCODE cTok, sal_Int32& rIndex ) co } } -STRING& STRING::Append( const STRCODE* pCharStr, xub_StrLen nCharLen ) -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - DBG_ASSERT( pCharStr, "String::Append() - pCharStr is NULL" ); - - if ( nCharLen == STRING_LEN ) - nCharLen = ImplStringLen( pCharStr ); - -#ifdef DBG_UTIL - if ( DbgIsAssert() ) - { - for ( xub_StrLen i = 0; i < nCharLen; i++ ) - { - if ( !pCharStr[i] ) - { - OSL_FAIL( "String::Append() : nLen is wrong" ); - } - } - } -#endif - - // Catch overflow - sal_Int32 nLen = mpData->mnLen; - sal_Int32 nCopyLen = ImplGetCopyLen( nLen, nCharLen ); - - if ( nCopyLen ) - { - // allocate string of new size - STRINGDATA* pNewData = ImplAllocData( nLen+nCopyLen ); - - // copy string - memcpy( pNewData->maStr, mpData->maStr, nLen*sizeof( STRCODE ) ); - memcpy( pNewData->maStr+nLen, pCharStr, nCopyLen*sizeof( STRCODE ) ); - - // free old string - STRING_RELEASE((STRING_TYPE *)mpData); - mpData = pNewData; - } - - return *this; -} - STRING& STRING::Append( STRCODE c ) { DBG_CHKTHIS( STRING, DBGCHECKSTRING ); diff --git a/unusedcode.easy b/unusedcode.easy index 042fca5..f96a778 100644 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -63,8 +63,6 @@ SfxGrabBagItem::SetGrabBag(std::__debug::map<rtl::OUString, com::sun::star::uno: SfxTemplatePanelControl::SetParagraphFamily() SmFontPickList::Contains(Font const&) const SmParser::Insert(rtl::OUString const&, int) -String::Append(unsigned short const*) -String::Append(unsigned short const*, unsigned short) String::Assign(unsigned short const*) String::Insert(String const&, unsigned short, unsigned short, unsigned short) String::String(char)
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits