[Libreoffice-commits] core.git: 2 commits - basctl/source basic/source dbaccess/source desktop/qa drawinglayer/source editeng/inc editeng/source filter/source include/editeng include/svx include/vcl o

2020-10-27 Thread Noel Grandin (via logerrit)
 basctl/source/basicide/baside2.cxx   |2 
 basic/source/sbx/sbxdec.cxx  |2 
 dbaccess/source/ui/app/AppIconControl.cxx|2 
 desktop/qa/desktop_lib/test_desktop_lib.cxx  |4 -
 drawinglayer/source/primitive2d/textlayoutdevice.cxx |6 +-
 drawinglayer/source/processor2d/vclprocessor2d.cxx   |2 
 editeng/inc/editdoc.hxx  |2 
 editeng/source/editeng/impedit3.cxx  |2 
 editeng/source/misc/txtrange.cxx |   24 +--
 filter/source/graphicfilter/ieps/ieps.cxx|4 -
 filter/source/svg/svgwriter.cxx  |2 
 include/editeng/txtrange.hxx |4 -
 include/svx/xtable.hxx   |2 
 include/vcl/layout.hxx   |4 -
 include/vcl/toolkit/treelistbox.hxx  |2 
 oox/source/core/xmlfilterbase.cxx|4 +
 oox/source/drawingml/fillproperties.cxx  |2 
 oox/source/export/chartexport.cxx|   19 +
 oox/source/export/drawingml.cxx  |2 
 reportdesign/source/ui/report/ReportWindow.cxx   |2 
 sc/inc/dpgroup.hxx   |2 
 sc/inc/dptabdat.hxx  |   10 ++--
 sc/inc/dptabres.hxx  |2 
 sc/inc/dptabsrc.hxx  |8 +--
 sc/source/core/data/dpgroup.cxx  |   10 ++--
 sc/source/core/data/dpobject.cxx |2 
 sc/source/core/data/dptabdat.cxx |2 
 sc/source/core/data/dptabsrc.cxx |   14 +++---
 sc/source/core/data/table2.cxx   |2 
 sc/source/core/data/table4.cxx   |2 
 sc/source/core/inc/interpre.hxx  |4 -
 sc/source/core/tool/interpr3.cxx |6 +-
 sc/source/core/tool/interpr5.cxx |2 
 sc/source/filter/excel/xepivotxml.cxx|6 +-
 sc/source/ui/docshell/docsh8.cxx |4 -
 sc/source/ui/inc/pfuncache.hxx   |4 -
 sc/source/ui/inc/preview.hxx |6 +-
 sc/source/ui/view/output.cxx |2 
 sc/source/ui/view/output2.cxx|2 
 sc/source/ui/view/preview.cxx|2 
 sc/source/ui/view/tabview.cxx|6 +-
 sd/source/ui/view/drtxtob1.cxx   |   10 ++--
 sd/source/ui/view/drviewse.cxx   |4 -
 sd/source/ui/view/outlnvs2.cxx   |4 -
 sd/source/ui/view/viewshel.cxx   |4 -
 sfx2/source/sidebar/PanelLayout.cxx  |2 
 starmath/source/dialog.cxx   |4 -
 starmath/source/edit.cxx |2 
 starmath/source/node.cxx |4 -
 svtools/source/brwbox/brwbox1.cxx|6 +-
 svtools/source/control/ctrlbox.cxx   |6 +-
 svx/source/dialog/fntctrl.cxx|2 
 svx/source/dialog/framelinkarray.cxx |   10 ++--
 svx/source/dialog/rulritem.cxx   |4 -
 svx/source/inc/fmshimp.hxx   |2 
 svx/source/svdraw/svdotext.cxx   |4 -
 sw/inc/redline.hxx   |2 
 sw/qa/extras/layout/layout.cxx   |   20 +
 sw/qa/extras/ww8export/ww8export2.cxx|4 -
 sw/source/core/doc/DocumentStatisticsManager.cxx |2 
 sw/source/core/layout/dbg_lay.cxx|2 
 sw/source/core/layout/newfrm.cxx |2 
 sw/source/core/layout/tabfrm.cxx |2 
 sw/source/core/layout/wsfrm.cxx  |2 
 sw/source/core/table/swnewtable.cxx  |2 
 sw/source/core/table/swtable.cxx |   12 ++---
 sw/source/core/text/inftxt.hxx   |6 +-
 sw/source/core/text/itrform2.cxx |6 +-
 sw/source/core/text/porlay.cxx   |2 
 sw/source/core/text/porlay.hxx   |4 -
 sw/source/core/text/pormulti.cxx |4 -
 sw/source/core/text/txtfly.cxx   |2 
 sw/source/filter/html/htmlcss1.cxx   |4 -
 sw/source/filter/writer/wrtswtbl.cxx |2 
 sw/source/filter/ww8/WW8TableInfo.hxx|2 
 sw/source/filter/ww8/ww8par.cxx  |2 
 sw/source/ui/index/cnttab.cxx|   10 ++--
 sw/source/uibase/shells/tabsh.cxx|4 -
 tools/qa/cppunit/test_bigint.cxx |   12 +

[Libreoffice-commits] core.git: 2 commits - basctl/source basic/source canvas/source compilerplugins/clang solenv/CompilerTest_compilerplugins_clang.mk

2020-01-23 Thread Noel Grandin (via logerrit)
 basctl/source/basicide/moduldl2.cxx |2 
 basctl/source/basicide/scriptdocument.cxx   |6 -
 basic/source/classes/sbunoobj.cxx   |2 
 canvas/source/opengl/ogl_spritedevicehelper.cxx |4 
 canvas/source/tools/page.cxx|2 
 canvas/source/tools/pagemanager.cxx |4 
 canvas/source/tools/surfaceproxymanager.cxx |2 
 canvas/source/vcl/canvas.cxx|2 
 canvas/source/vcl/canvasbitmaphelper.cxx|2 
 canvas/source/vcl/canvascustomsprite.cxx|6 -
 canvas/source/vcl/canvashelper.cxx  |4 
 canvas/source/vcl/canvashelper_texturefill.cxx  |4 
 canvas/source/vcl/spritecanvas.cxx  |2 
 canvas/source/vcl/spritedevicehelper.cxx|2 
 compilerplugins/clang/makeshared.cxx|  137 
 compilerplugins/clang/test/makeshared.cxx   |   43 +++
 solenv/CompilerTest_compilerplugins_clang.mk|1 
 17 files changed, 203 insertions(+), 22 deletions(-)

New commits:
commit 8d23f9c2c1e0479a95cb44a09066740213b0f99a
Author: Noel Grandin 
AuthorDate: Thu Jan 23 15:17:46 2020 +0200
Commit: Noel Grandin 
CommitDate: Fri Jan 24 07:18:28 2020 +0100

loplugin:makeshared in basctl..canvas

Change-Id: I1461da594db222abbaeccfb636194b9790f5dbe8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87271
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/basctl/source/basicide/moduldl2.cxx 
b/basctl/source/basicide/moduldl2.cxx
index 38e07178d33d..c0ab18750539 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -637,7 +637,7 @@ void LibPage::InsertLib()
 // library import dialog
 if (!xLibDlg)
 {
-xLibDlg.reset(new LibDialog(m_pDialog->getDialog()));
+xLibDlg = std::make_shared(m_pDialog->getDialog());
 xLibDlg->SetStorageName( aURLObj.getName() );
 }
 
diff --git a/basctl/source/basicide/scriptdocument.cxx 
b/basctl/source/basicide/scriptdocument.cxx
index 25a705cf69df..cedadda510cf 100644
--- a/basctl/source/basicide/scriptdocument.cxx
+++ b/basctl/source/basicide/scriptdocument.cxx
@@ -1017,19 +1017,19 @@ namespace basctl
 
 
 ScriptDocument::ScriptDocument()
-:m_pImpl(new Impl)
+:m_pImpl(std::make_shared())
 { }
 
 
 ScriptDocument::ScriptDocument( ScriptDocument::SpecialDocument _eType )
-:m_pImpl( new Impl( Reference< XModel >() ) )
+:m_pImpl( std::make_shared( Reference< XModel >() ) )
 {
 OSL_ENSURE( _eType == NoDocument, "ScriptDocument::ScriptDocument: 
unknown SpecialDocument type!" );
 }
 
 
 ScriptDocument::ScriptDocument( const Reference< XModel >& _rxDocument )
-:m_pImpl( new Impl( _rxDocument ) )
+:m_pImpl( std::make_shared( _rxDocument ) )
 {
 OSL_ENSURE( _rxDocument.is(), "ScriptDocument::ScriptDocument: 
document must not be NULL!" );
 // a NULL document results in an uninitialized instance, and for 
this
diff --git a/basic/source/classes/sbunoobj.cxx 
b/basic/source/classes/sbunoobj.cxx
index 4b84fffe5ba8..ab3d5e54be40 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -2362,7 +2362,7 @@ SbUnoObject::SbUnoObject( const OUString& aName_, const 
Any& aUnoObj_ )
 bSetClassName = true;
 }
 StructRefInfo aThisStruct( maTmpUnoObj, maTmpUnoObj.getValueType(), 0 
);
-maStructInfo.reset( new SbUnoStructRefObject( GetName(), aThisStruct ) 
);
+maStructInfo = std::make_shared( GetName(), 
aThisStruct );
 }
 else if( eType == TypeClass_INTERFACE )
 {
diff --git a/canvas/source/opengl/ogl_spritedevicehelper.cxx 
b/canvas/source/opengl/ogl_spritedevicehelper.cxx
index be838393c5fd..6a1d935c9ba9 100644
--- a/canvas/source/opengl/ogl_spritedevicehelper.cxx
+++ b/canvas/source/opengl/ogl_spritedevicehelper.cxx
@@ -78,7 +78,7 @@ namespace oglcanvas
 mpSpriteCanvas(nullptr),
 maActiveSprites(),
 maLastUpdate(),
-mpTextureCache(new TextureCache()),
+mpTextureCache(std::make_shared()),
 mnLinearTwoColorGradientProgram(0),
 mnLinearMultiColorGradientProgram(0),
 mnRadialTwoColorGradientProgram(0),
@@ -543,7 +543,7 @@ namespace oglcanvas
 
 IBufferContextSharedPtr SpriteDeviceHelper::createBufferContext(const 
::basegfx::B2IVector& rSize) const
 {
-return IBufferContextSharedPtr(new BufferContextImpl(rSize));
+return std::make_shared(rSize);
 }
 
 TextureCache& SpriteDeviceHelper::getTextureCache() const
diff --git a/canvas/source/tools/page.cxx b/canvas/source/tools/page.cxx
index 78f9cd3aa671..3537fa0b6873 100644
--- a/canvas/source/tools/page.cxx
+++ b/canvas/source/tools/page.cxx
@@ -48,7 +48,7 @@ namespace canvas
 SurfaceRect rect(rSize);
 if(insert(rect))
 {
-  

[Libreoffice-commits] core.git: 2 commits - basctl/source basic/source

2019-07-19 Thread Caolán McNamara (via logerrit)
 basctl/source/dlged/dlged.cxx|   11 +--
 basic/source/runtime/methods.cxx |2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)

New commits:
commit 7988e38a1b627b92a69dd11eabc495ff180df34d
Author: Caolán McNamara 
AuthorDate: Thu Jul 18 12:11:04 2019 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jul 19 11:14:12 2019 +0200

cid#1448451 Use after free

Change-Id: I6df7a2d117be1c8f7a3e00387006c69857a98b1c
Reviewed-on: https://gerrit.libreoffice.org/75914
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index c318ba8739d7..33d10a9ed7df 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -635,21 +635,20 @@ void DlgEditor::CreateDefaultObject()
 
 // insert object into drawing page
 SdrPageView* pPageView = pDlgEdView->GetSdrPageView();
-pDlgEdView->InsertObjectAtView( pDlgEdObj, *pPageView);
-
-// start listening
-pDlgEdObj->StartListening();
+if (pDlgEdView->InsertObjectAtView(pDlgEdObj, *pPageView))
+{
+// start listening
+pDlgEdObj->StartListening();
+}
 }
 }
 
-
 void DlgEditor::Cut()
 {
 Copy();
 Delete();
 }
 
-
 static void implCopyStreamToByteSequence( const Reference< XInputStream >& 
xStream,
 Sequence< sal_Int8 >& bytes )
 {
commit 7201db417cfdb115d7dc84f844c0966a82014cbd
Author: Caolán McNamara 
AuthorDate: Thu Jul 18 11:22:46 2019 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jul 19 11:14:00 2019 +0200

cid#1448547 Unchecked return value

Change-Id: If0b19a53bba10064a81a22856cd3796dcefd1f68
Reviewed-on: https://gerrit.libreoffice.org/75903
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 1119adf3d9e1..fe266fdc009c 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -779,7 +779,7 @@ void SbRtl_FileLen(StarBASIC *, SbxArray & rPar, bool)
 DirectoryItem aItem;
 (void)DirectoryItem::get( getFullPath( aStr ), aItem );
 FileStatus aFileStatus( osl_FileStatus_Mask_FileSize );
-aItem.getFileStatus( aFileStatus );
+(void)aItem.getFileStatus( aFileStatus );
 nLen = static_cast(aFileStatus.getFileSize());
 }
 rPar.Get(0)->PutLong( static_cast(nLen) );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: 2 commits - basctl/source basic/source

2016-09-20 Thread Stephan Bergmann
 basctl/source/basicide/basides2.cxx |9 -
 basic/source/runtime/runtime.cxx|9 +
 2 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit e27a0ec89f6d13be0ddf4d68b844a78f939f7bf9
Author: Stephan Bergmann 
Date:   Tue Sep 20 11:19:32 2016 +0200

Related cid#1371289: Improve code to not depend on missing move assignment

Change-Id: Id254fa76cafe33a36646d517d224ba6a05406c09

diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 1fba866..6082437 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -2019,18 +2019,19 @@ void SbiRuntime::StepLSET()
 
 sal_Int32 nVarStrLen = aRefVarString.getLength();
 sal_Int32 nValStrLen = aRefValString.getLength();
-OUStringBuffer aNewStr;
+OUString aNewStr;
 if( nVarStrLen > nValStrLen )
 {
-aNewStr.append(aRefValString);
-comphelper::string::padToLength(aNewStr, nVarStrLen, ' ');
+OUStringBuffer buf(aRefValString);
+comphelper::string::padToLength(buf, nVarStrLen, ' ');
+aNewStr = buf.makeStringAndClear();
 }
 else
 {
 aNewStr = aRefValString.copy( 0, nVarStrLen );
 }
 
-refVar->PutString(aNewStr.makeStringAndClear());
+refVar->PutString(aNewStr);
 refVar->SetFlags( n );
 }
 }
commit cf62e6c1d87bdee8021351cefaedec0796e15c90
Author: Stephan Bergmann 
Date:   Tue Sep 20 11:19:18 2016 +0200

Related cid#1371289: Improve code to not depend on missing move assignment

Change-Id: I332010574a2ddd13590452f08da32f21f8ef882b

diff --git a/basctl/source/basicide/basides2.cxx 
b/basctl/source/basicide/basides2.cxx
index 98c0dfb..40bd5c4 100644
--- a/basctl/source/basicide/basides2.cxx
+++ b/basctl/source/basicide/basides2.cxx
@@ -96,21 +96,20 @@ sal_uInt16 Shell::SetPrinter( SfxPrinter *pNewPrinter, 
SfxPrinterChangeFlags )
 
 void Shell::SetMDITitle()
 {
-OUStringBuffer aTitleBuf;
+OUString aTitle;
 if ( !m_aCurLibName.isEmpty() )
 {
 LibraryLocation eLocation = m_aCurDocument.getLibraryLocation( 
m_aCurLibName );
-aTitleBuf = m_aCurDocument.getTitle(eLocation) + "." + m_aCurLibName ;
+aTitle = m_aCurDocument.getTitle(eLocation) + "." + m_aCurLibName ;
 }
 else
-aTitleBuf = IDE_RESSTR(RID_STR_ALL) ;
+aTitle = IDE_RESSTR(RID_STR_ALL) ;
 
 DocumentSignature aCurSignature( m_aCurDocument );
 if ( aCurSignature.getScriptingSignatureState() == SignatureState::OK )
 {
-aTitleBuf = aTitleBuf + " " + IDE_RESSTR(RID_STR_SIGNED) + " ";
+aTitle += " " + IDE_RESSTR(RID_STR_SIGNED) + " ";
 }
-OUString aTitle(aTitleBuf.makeStringAndClear());
 
 SfxViewFrame* pViewFrame = GetViewFrame();
 if ( pViewFrame )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - basctl/source basic/source chart2/source cui/source dbaccess/source desktop/source editeng/source extensions/source scripting/source sc/source sd/source sfx

2016-07-26 Thread Caolán McNamara
 basctl/source/basicide/baside2.cxx |6 +-
 basctl/source/basicide/baside2b.cxx|2 
 basctl/source/basicide/baside3.cxx |2 
 basctl/source/basicide/basides1.cxx|6 +-
 basctl/source/basicide/basidesh.cxx|2 
 basctl/source/basicide/basobj2.cxx |4 -
 basctl/source/basicide/bastypes.cxx|2 
 basctl/source/basicide/macrodlg.cxx|6 +-
 basctl/source/basicide/moduldl2.cxx|   28 ++---
 basctl/source/basicide/moduldlg.cxx|6 +-
 basic/source/runtime/basrdll.cxx   |2 
 basic/source/runtime/iosys.cxx |8 +--
 chart2/source/controller/dialogs/DataBrowser.cxx   |4 -
 chart2/source/controller/dialogs/tp_Scale.cxx  |2 
 chart2/source/controller/main/ChartController_Window.cxx   |2 
 cui/source/customize/cfg.cxx   |   10 ++--
 cui/source/dialogs/cuifmsearch.cxx |2 
 cui/source/dialogs/cuigaldlg.cxx   |2 
 cui/source/dialogs/insdlg.cxx  |6 +-
 cui/source/dialogs/multipat.cxx|4 -
 cui/source/options/optdict.cxx |2 
 cui/source/options/optinet2.cxx|2 
 cui/source/options/optjava.cxx |4 -
 cui/source/options/treeopt.cxx |2 
 cui/source/tabpages/page.cxx   |2 
 cui/source/tabpages/tparea.cxx |2 
 cui/source/tabpages/tpcolor.cxx|6 +-
 cui/source/tabpages/tplnedef.cxx   |6 +-
 cui/source/tabpages/tplneend.cxx   |6 +-
 dbaccess/source/ui/browser/brwctrlr.cxx|2 
 dbaccess/source/ui/dlg/ConnectionHelper.cxx|2 
 dbaccess/source/ui/dlg/TextConnectionHelper.cxx|2 
 dbaccess/source/ui/dlg/paramdialog.cxx |2 
 dbaccess/source/ui/misc/UITools.cxx|2 
 dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx   |2 
 dbaccess/source/ui/querydesign/QueryDesignView.cxx |4 -
 dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx  |   12 ++---
 dbaccess/source/ui/querydesign/querycontroller.cxx |4 -
 dbaccess/source/ui/relationdesign/RelationController.cxx   |2 
 desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx |4 -
 editeng/source/editeng/editdbg.cxx |2 
 editeng/source/editeng/editeng.cxx |2 
 editeng/source/misc/unolingu.cxx   |2 
 extensions/source/abpilot/abspilot.cxx |2 
 extensions/source/propctrlr/propcontroller.cxx |2 
 extensions/source/update/ui/updatecheckui.cxx  |2 
 sc/source/ui/dbgui/consdlg.cxx |2 
 sc/source/ui/dbgui/dbnamdlg.cxx|2 
 sc/source/ui/dbgui/filtdlg.cxx |2 
 sc/source/ui/dbgui/scendlg.cxx |4 -
 sc/source/ui/dbgui/sfiltdlg.cxx|2 
 sc/source/ui/dbgui/tpsort.cxx  |2 
 sc/source/ui/docshell/dbdocfun.cxx |2 
 sc/source/ui/docshell/docfunc.cxx  |4 -
 sc/source/ui/miscdlgs/crnrdlg.cxx  |4 -
 sc/source/ui/miscdlgs/filldlg.cxx  |2 
 sc/source/ui/miscdlgs/instbdlg.cxx |2 
 sc/source/ui/miscdlgs/optsolver.cxx|2 
 sc/source/ui/miscdlgs/scuiautofmt.cxx  |6 +-
 sc/source/ui/miscdlgs/solvrdlg.cxx |2 
 sc/source/ui/miscdlgs/tabopdlg.cxx |2 
 sc/source/ui/navipi/scenwnd.cxx|2 
 sc/source/ui/optdlg/tpcalc.cxx |2 
 sc/source/ui/optdlg/tpusrlst.cxx   |8 +--
 sc/source/ui/pagedlg/areasdlg.cxx  |2 
 sc/source/ui/view/cellsh2.cxx  |2 
 sc/source/ui/view/cellsh3.cxx  |2 
 sc/source/ui/view/dbfunc.cxx   |2 
 sc/source/ui/view/dbfunc3.cxx  |2 
 sc/source/ui/view/spelleng.cxx |4 -
 sc/source/ui/view/tabvwshf.cxx |4 -
 sc/source/ui/view/viewfunc.cxx |2 
 scripting/source/dlgprov/dlgevtatt.cxx  

[Libreoffice-commits] core.git: 2 commits - basctl/source basic/source

2015-03-09 Thread Caolán McNamara
 basctl/source/basicide/baside2.cxx  |2 +-
 basctl/source/basicide/baside2b.cxx |2 +-
 basctl/source/basicide/basobj2.cxx  |2 +-
 basctl/source/basicide/bastypes.cxx |2 +-
 basic/source/sbx/sbxstr.cxx |8 
 5 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 34d6ec2c6e6618beacac881ec28ab527b25558d1
Author: Caolán McNamara 
Date:   Mon Mar 9 13:33:08 2015 +

cppcheck: variableScope

Change-Id: Ie77a988956927475ea384c36664ca7c3dd00b2a7

diff --git a/basic/source/sbx/sbxstr.cxx b/basic/source/sbx/sbxstr.cxx
index bfd2b62..990d1c7 100644
--- a/basic/source/sbx/sbxstr.cxx
+++ b/basic/source/sbx/sbxstr.cxx
@@ -262,13 +262,13 @@ SbxArray* StringToByteArray(const OUString& rStr)
 sal_Int32 nArraySize = rStr.getLength() * 2;
 const sal_Unicode* pSrc = rStr.getStr();
 SbxDimArray* pArray = new SbxDimArray(SbxBYTE);
+if( nArraySize )
+{
 #if !HAVE_FEATURE_SCRIPTING
-bool bIncIndex = false;
+bool bIncIndex = false;
 #else
-bool bIncIndex = ( IsBaseIndexOne() && SbiRuntime::isVBAEnabled() );
+bool bIncIndex = ( IsBaseIndexOne() && SbiRuntime::isVBAEnabled() );
 #endif
-if( nArraySize )
-{
 if( bIncIndex )
 pArray->AddDim32( 1, nArraySize );
 else
commit 938caeaf5850b63ed74c1d8a4d95c3bedbb66298
Author: Caolán McNamara 
Date:   Mon Mar 9 13:28:49 2015 +

cppcheck: cstyleCast

Change-Id: I3a1aaafe30f13f2eb388f7db3d78ecafaf0a4a2d

diff --git a/basctl/source/basicide/baside2.cxx 
b/basctl/source/basicide/baside2.cxx
index d73ecd3..35ddb67 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -218,7 +218,7 @@ SbModuleRef ModulWindow::XModule()
 if ( pBasic )
 {
 xBasic = pBasic;
-xModule = (SbModule*)pBasic->FindModule( GetName() );
+xModule = pBasic->FindModule( GetName() );
 }
 }
 }
diff --git a/basctl/source/basicide/baside2b.cxx 
b/basctl/source/basicide/baside2b.cxx
index 58a28f8..ca647a8 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1811,7 +1811,7 @@ IMPL_LINK_NOARG_INLINE_START(WatchWindow, TreeListHdl)
 {
 SvTreeListEntry* pCurEntry = aTreeListBox.GetCurEntry();
 if ( pCurEntry && pCurEntry->GetUserData() )
-aXEdit.SetText( ((WatchItem*)pCurEntry->GetUserData())->maName );
+aXEdit.SetText( 
static_cast(pCurEntry->GetUserData())->maName );
 
 return 0;
 }
diff --git a/basctl/source/basicide/basobj2.cxx 
b/basctl/source/basicide/basobj2.cxx
index 9834875..3bde7a4 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -173,7 +173,7 @@ bool RenameModule (
 pWin->SetName( rNewName );
 
 // set new module in module window
-pWin->SetSbModule( (SbModule*)pWin->GetBasic()->FindModule( 
rNewName ) );
+pWin->SetSbModule( pWin->GetBasic()->FindModule( rNewName ) );
 
 // update tabwriter
 sal_uInt16 nId = pShell->GetWindowId( pWin );
diff --git a/basctl/source/basicide/bastypes.cxx 
b/basctl/source/basicide/bastypes.cxx
index e6039e3..88fd1ce 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -522,7 +522,7 @@ void TabBar::Command( const CommandEvent& rCEvt )
 Shell::WindowTableIt it = aWindowTable.find( 
GetCurPageId() );
 if (it != aWindowTable.end() && 
dynamic_cast(it->second))
 {
-SbModule* pActiveModule = 
(SbModule*)pBasic->FindModule( it->second->GetName() );
+SbModule* pActiveModule = pBasic->FindModule( 
it->second->GetName() );
 if( pActiveModule && ( 
pActiveModule->GetModuleType() == script::ModuleType::DOCUMENT ) )
 {
 aPopup.EnableItem(SID_BASICIDE_DELETECURRENT, 
false);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - basctl/source basic/source tools/inc

2013-04-12 Thread Tor Lillqvist
 basctl/source/basicide/iderdll.cxx |2 +-
 basic/source/classes/sb.cxx|9 +++--
 basic/source/classes/sbintern.cxx  |   12 +---
 basic/source/inc/sbintern.hxx  |1 +
 tools/inc/tools/shl.hxx|2 +-
 5 files changed, 11 insertions(+), 15 deletions(-)

New commits:
commit c3d8b06f0058d808aa62c27d06f77e2a25747dd2
Author: Tor Lillqvist 
Date:   Fri Apr 12 23:02:29 2013 +0300

Get rid of SHL_SBC

GetAppData(SHL_SBC) was used only locally in the sb library so no need for
it. Just use a static pointer field.

Change-Id: I37c8429b6c9e521a00c52bb622f78bdc4afe345c

diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 6334737..7154e1e 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -25,7 +25,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -964,12 +963,10 @@ StarBASIC::~StarBASIC()
 RemoveFactory( GetSbData()->pFormFac );
 delete GetSbData()->pFormFac; GetSbData()->pFormFac = NULL;
 
-SbiGlobals** pp = (SbiGlobals**) ::GetAppData( SHL_SBC );
-SbiGlobals* p = *pp;
-if( p )
+if( SbiGlobals::pGlobals )
 {
-delete p;
-*pp = 0;
+delete SbiGlobals::pGlobals;
+SbiGlobals::pGlobals = 0;
 }
 }
 else if( bDocBasic )
diff --git a/basic/source/classes/sbintern.cxx 
b/basic/source/classes/sbintern.cxx
index fb3f802..6b3fa49 100644
--- a/basic/source/classes/sbintern.cxx
+++ b/basic/source/classes/sbintern.cxx
@@ -17,8 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include 
-
 #include "sbintern.hxx"
 #include "sbunoobj.hxx"
 #include "token.hxx"
@@ -27,13 +25,13 @@
 #include "codegen.hxx"
 #include 
 
+SbiGlobals* SbiGlobals::pGlobals = 0;
+
 SbiGlobals* GetSbData()
 {
-SbiGlobals** pp = (SbiGlobals**) ::GetAppData( SHL_SBC );
-SbiGlobals* p = *pp;
-if( !p )
-p = *pp = new SbiGlobals;
-return p;
+if( !SbiGlobals::pGlobals )
+SbiGlobals::pGlobals = new SbiGlobals;
+return SbiGlobals::pGlobals;
 }
 
 SbiGlobals::SbiGlobals()
diff --git a/basic/source/inc/sbintern.hxx b/basic/source/inc/sbintern.hxx
index 7dfd011..401f7af 100644
--- a/basic/source/inc/sbintern.hxx
+++ b/basic/source/inc/sbintern.hxx
@@ -80,6 +80,7 @@ public:
 
 struct SbiGlobals
 {
+static SbiGlobals* pGlobals;
 SbiInstance*pInst;  // all active runtime instances
 SbiFactory* pSbFac; // StarBASIC-Factory
 SbUnoFactory*   pUnoFac;// Factory for Uno-Structs at DIM AS NEW
diff --git a/tools/inc/tools/shl.hxx b/tools/inc/tools/shl.hxx
index c7072bf..945921f 100644
--- a/tools/inc/tools/shl.hxx
+++ b/tools/inc/tools/shl.hxx
@@ -53,7 +53,7 @@
 //25 (SHL_LNKCCH) removed
 //26 (SHL_CHANNEL) removed
 //27 (SHL_SBX) removed
-#define SHL_SBC 28
+//28 (SHL_SBC) removed
 //29 (SHL_SDB) removed
 //30 (SHL_SBA) removed
 //31 (SHL_SBA2) removed
commit 9be3e8e8d52cfb00dff851ee221074b7efce46c1
Author: Tor Lillqvist 
Date:   Fri Apr 12 22:51:28 2013 +0300

Should initialise Module::mpModule to 0

Change-Id: Ie4648b82a524a7ddcd427d7d2543bc7691eddcf8

diff --git a/basctl/source/basicide/iderdll.cxx 
b/basctl/source/basicide/iderdll.cxx
index 07351ca..dd20ff6 100644
--- a/basctl/source/basicide/iderdll.cxx
+++ b/basctl/source/basicide/iderdll.cxx
@@ -50,7 +50,7 @@ namespace basctl
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 
-Module* Module::mpModule;
+Module* Module::mpModule = 0;
 
 namespace
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits