[Libreoffice-commits] core.git: basic/inc basic/source include/basic

2022-08-22 Thread Andreas Heinisch (via logerrit)
 basic/inc/sbxbase.hxx|1 +
 basic/source/classes/sb.cxx  |4 ++--
 basic/source/sbx/sbxbase.cxx |   17 +
 basic/source/sbx/sbxexec.cxx |2 +-
 basic/source/sbx/sbxobj.cxx  |2 +-
 include/basic/sbxcore.hxx|2 ++
 6 files changed, 24 insertions(+), 4 deletions(-)

New commits:
commit 7e2a8a9869e362ae181ad92f50ea287e9abf85bb
Author: Andreas Heinisch 
AuthorDate: Tue Aug 9 18:42:40 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Mon Aug 22 19:03:42 2022 +0200

tdf#150139 - Add a concrete name to the error message

Add a concrete name to the "Property or method not found: $(ARG1)" error 
message when creating a listener.

Change-Id: I76c904793a96082c49f8aa2d45c76c50a453d892
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138061
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/basic/inc/sbxbase.hxx b/basic/inc/sbxbase.hxx
index 80552c2fbf08..e06d76161dec 100644
--- a/basic/inc/sbxbase.hxx
+++ b/basic/inc/sbxbase.hxx
@@ -36,6 +36,7 @@ class SbxBasicFormater;
 struct SbxAppData
 {
 ErrCode eErrCode; // Error code
+OUString aErrorMsg; // Error message for $ARG
 SbxVariableRef m_aGlobErr; // Global error object
 std::vector m_Factories; // these are owned by fields in 
SbiGlobals
 tools::SvRef mrImplRepository;
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 8d87330e469b..f1ab6dd1da0c 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1325,11 +1325,11 @@ bool StarBASIC::Call( const OUString& rName, SbxArray* 
pParam )
 if( !bRes )
 {
 ErrCode eErr = SbxBase::GetError();
-SbxBase::ResetError();
 if( eErr != ERRCODE_NONE )
 {
-RTError( eErr, OUString(), 0, 0, 0 );
+RTError(eErr, SbxBase::GetErrorMsg(), 0, 0, 0);
 }
+SbxBase::ResetError();
 }
 return bRes;
 }
diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx
index 3b70307ec3e7..9d2129e68a1e 100644
--- a/basic/source/sbx/sbxbase.cxx
+++ b/basic/source/sbx/sbxbase.cxx
@@ -37,6 +37,7 @@
 
 SbxAppData::SbxAppData()
 : eErrCode(ERRCODE_NONE)
+, aErrorMsg(OUString())
 , eBasicFormaterLangType(LANGUAGE_DONTKNOW)
 {
 }
@@ -96,6 +97,21 @@ ErrCode const & SbxBase::GetError()
 return GetSbxData_Impl().eErrCode;
 }
 
+OUString const & SbxBase::GetErrorMsg()
+{
+return GetSbxData_Impl().aErrorMsg;
+}
+
+void SbxBase::SetError(ErrCode e, const OUString& rMsg)
+{
+SbxAppData& r = GetSbxData_Impl();
+if (e && r.eErrCode == ERRCODE_NONE)
+{
+r.eErrCode = e;
+r.aErrorMsg = rMsg;
+}
+}
+
 void SbxBase::SetError( ErrCode e )
 {
 SbxAppData& r = GetSbxData_Impl();
@@ -111,6 +127,7 @@ bool SbxBase::IsError()
 void SbxBase::ResetError()
 {
 GetSbxData_Impl().eErrCode = ERRCODE_NONE;
+GetSbxData_Impl().aErrorMsg = OUString();
 }
 
 void SbxBase::AddFactory( SbxFactory* pFac )
diff --git a/basic/source/sbx/sbxexec.cxx b/basic/source/sbx/sbxexec.cxx
index d830061f071d..f3abca766d35 100644
--- a/basic/source/sbx/sbxexec.cxx
+++ b/basic/source/sbx/sbxexec.cxx
@@ -323,7 +323,7 @@ static SbxVariableRef Element
 }
 }
 else
-SbxBase::SetError( ERRCODE_BASIC_NO_METHOD );
+SbxBase::SetError( ERRCODE_BASIC_NO_METHOD, aSym );
 }
 *ppBuf = p;
 return refVar;
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx
index f83324a26bb8..4dd054959823 100644
--- a/basic/source/sbx/sbxobj.cxx
+++ b/basic/source/sbx/sbxobj.cxx
@@ -275,7 +275,7 @@ bool SbxObject::Call( const OUString& rName, SbxArray* 
pParam )
 pMeth->SetParameters( nullptr );
 return true;
 }
-SetError( ERRCODE_BASIC_NO_METHOD );
+SetError( ERRCODE_BASIC_NO_METHOD, rName );
 return false;
 }
 
diff --git a/include/basic/sbxcore.hxx b/include/basic/sbxcore.hxx
index e5f726e8d016..477858d9656c 100644
--- a/include/basic/sbxcore.hxx
+++ b/include/basic/sbxcore.hxx
@@ -85,7 +85,9 @@ public:
 virtual boolLoadCompleted();
 
 static ErrCode const & GetError();
+static OUString const& GetErrorMsg();
 static void SetError( ErrCode );
+static void SetError(ErrCode, const OUString&);
 static bool IsError();
 static void ResetError();
 


[Libreoffice-commits] core.git: basic/inc basic/source include/basic

2022-05-31 Thread Noel Grandin (via logerrit)
 basic/inc/sbxform.hxx   |   16 ++---
 basic/source/basmgr/basmgr.cxx  |   37 
 basic/source/classes/sbunoobj.cxx   |   19 
 basic/source/classes/sbxmod.cxx |5 ++--
 basic/source/comp/exprnode.cxx  |5 ++--
 basic/source/comp/scanner.cxx   |5 ++--
 basic/source/comp/symtbl.cxx|5 ++--
 basic/source/inc/dlgcont.hxx|4 +--
 basic/source/inc/expr.hxx   |2 -
 basic/source/inc/namecont.hxx   |4 +--
 basic/source/inc/sbunoobj.hxx   |   17 +++---
 basic/source/inc/scanner.hxx|2 -
 basic/source/inc/symtbl.hxx |2 -
 basic/source/runtime/comenumwrapper.hxx |5 ++--
 basic/source/runtime/runtime.cxx|   11 +
 basic/source/sbx/sbxform.cxx|   33 ++--
 basic/source/sbx/sbxvar.cxx |5 ++--
 basic/source/uno/dlgcont.cxx|9 ---
 basic/source/uno/namecont.cxx   |7 +++---
 include/basic/basmgr.hxx|9 ---
 include/basic/sbx.hxx   |7 +++---
 21 files changed, 112 insertions(+), 97 deletions(-)

New commits:
commit 5ecdedbf81af5516ff7d2195383dc9d6389fb0d0
Author: Noel Grandin 
AuthorDate: Tue May 31 10:23:21 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue May 31 15:11:27 2022 +0200

clang-tidy modernize-pass-by-value in basic

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

diff --git a/basic/inc/sbxform.hxx b/basic/inc/sbxform.hxx
index 8accc399547a..c14d950a8f6b 100644
--- a/basic/inc/sbxform.hxx
+++ b/basic/inc/sbxform.hxx
@@ -74,14 +74,14 @@ class SbxBasicFormater {
 // Constructor takes signs for decimal point, thousand separation sign
 // and necessary resource strings.
 SbxBasicFormater( sal_Unicode _cDecPoint, sal_Unicode _cThousandSep,
-  const OUString& _sOnStrg,
-  const OUString& _sOffStrg,
-  const OUString& _sYesStrg,
-  const OUString& _sNoStrg,
-  const OUString& _sTrueStrg,
-  const OUString& _sFalseStrg,
-  const OUString& _sCurrencyStrg,
-  const OUString& _sCurrencyFormatStrg );
+  OUString _sOnStrg,
+  OUString _sOffStrg,
+  OUString _sYesStrg,
+  OUString _sNoStrg,
+  OUString _sTrueStrg,
+  OUString _sFalseStrg,
+  OUString _sCurrencyStrg,
+  OUString _sCurrencyFormatStrg );
 
 /* Basic command: Format$( number,format-string )
 
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 4e01bff8cc9d..e21b0560bfda 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -107,9 +108,9 @@ class BasMgrContainerListenerImpl: public 
ContainerListenerHelper
 OUString maLibName;  // empty -> no lib, but lib container
 
 public:
-BasMgrContainerListenerImpl( BasicManager* pMgr, const OUString& aLibName )
+BasMgrContainerListenerImpl( BasicManager* pMgr, OUString aLibName )
 : mpMgr( pMgr )
-, maLibName( aLibName ) {}
+, maLibName(std::move( aLibName )) {}
 
 static void insertLibraryImpl( const uno::Reference< 
script::XLibraryContainer >& xScriptCont, BasicManager* pMgr,
const uno::Any& aLibAny, const OUString& 
aLibName );
@@ -1573,8 +1574,8 @@ class ModuleInfo_Impl : public ModuleInfoHelper
 OUString maSource;
 
 public:
-ModuleInfo_Impl( const OUString& aName, const OUString& aLanguage, const 
OUString& aSource )
-: maName( aName ), maLanguage( aLanguage), maSource( aSource ) {}
+ModuleInfo_Impl( OUString aName, OUString aLanguage, OUString aSource )
+: maName(std::move( aName )), maLanguage(std::move( aLanguage)), 
maSource(std::move( aSource )) {}
 
 // Methods XStarBasicModuleInfo
 virtual OUString SAL_CALL getName() override
@@ -1592,8 +1593,8 @@ class DialogInfo_Impl : public WeakImplHelper< 
script::XStarBasicDialogInfo >
 uno::Sequence< sal_Int8 > mData;
 
 public:
-DialogInfo_Impl( const OUString& aName, const uno::Sequence< sal_Int8 >& 
Data )
-: maName( aName ), mData( Data ) {}
+DialogInfo_Impl( OUString aName, const uno::Sequence< sal_Int8 >& Data )
+: maName(std::move( aName )), mData( Data ) {}
 
 // Methods XStarBasicDialogInfo
 virtual OUString SAL_CALL getName() override
@@ -1615,19 +1616,19 @@ class LibraryInfo_Impl : public 

[Libreoffice-commits] core.git: basic/inc basic/source codemaker/source comphelper/source compilerplugins/clang desktop/source framework/inc framework/source i18npool/source idl/source pyuno/source sa

2022-04-17 Thread Noel Grandin (via logerrit)
 basic/inc/sbxform.hxx |   10 -
 basic/source/sbx/sbxform.cxx  |   68 +-
 codemaker/source/javamaker/javatype.cxx   |   17 +-
 comphelper/source/misc/string.cxx |2 
 compilerplugins/clang/stringviewparam.cxx |3 
 desktop/source/app/dispatchwatcher.cxx|   10 -
 framework/inc/uifactory/configurationaccessfactorymanager.hxx |2 
 framework/source/uifactory/uielementfactorymanager.cxx|8 -
 i18npool/source/transliteration/transliteration_body.cxx  |4 
 idl/source/prj/svidl.cxx  |8 -
 pyuno/source/loader/pyuno_loader.cxx  |   16 +-
 sal/cppunittester/cppunittester.cxx   |   10 -
 scripting/source/provider/URIHelper.cxx   |8 -
 scripting/source/provider/URIHelper.hxx   |2 
 scripting/source/vbaevents/eventhelper.cxx|   14 +-
 svx/source/svdraw/svdmrkv.cxx |   62 -
 unodevtools/source/skeletonmaker/cpptypemaker.cxx |   12 -
 unodevtools/source/skeletonmaker/javacompskeleton.cxx |8 -
 unodevtools/source/skeletonmaker/javatypemaker.cxx|4 
 uui/source/iahndl-ssl.cxx |   14 +-
 uui/source/secmacrowarnings.cxx   |   18 +-
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   41 +++---
 22 files changed, 173 insertions(+), 168 deletions(-)

New commits:
commit 33bd16b344e273c427091ee68e946bf67b371dd7
Author: Noel Grandin 
AuthorDate: Sun Apr 3 10:34:37 2022 +0200
Commit: Noel Grandin 
CommitDate: Sun Apr 17 10:27:33 2022 +0200

loplugin:stringviewparam convert methods using copy()

which converts to std::string_view::substr()

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

diff --git a/basic/inc/sbxform.hxx b/basic/inc/sbxform.hxx
index 8ae9cb2db3f4..8accc399547a 100644
--- a/basic/inc/sbxform.hxx
+++ b/basic/inc/sbxform.hxx
@@ -93,7 +93,7 @@ class SbxBasicFormater {
 String containing the formatted output
 */
 OUString  BasicFormat( double dNumber, const OUString& sFormatStrg );
-static OUString BasicFormatNull( const OUString& sFormatStrg );
+static OUString BasicFormatNull( std::u16string_view sFormatStrg );
 
 static  bool isBasicFormat( std::u16string_view sFormatStrg );
 
@@ -112,10 +112,10 @@ class SbxBasicFormater {
 short  GetDigitAtPosExpScan( double dNewExponent, short nPos,
   bool& bFoundFirstDigit );
 short  GetDigitAtPosExpScan( short nPos, bool& bFoundFirstDigit );
-static OUString GetPosFormatString( const OUString& sFormatStrg, bool & 
bFound );
-static OUString GetNegFormatString( const OUString& sFormatStrg, bool & 
bFound );
-static OUString Get0FormatString( const OUString& sFormatStrg, bool & 
bFound );
-static OUString GetNullFormatString( const OUString& sFormatStrg, bool & 
bFound );
+static OUString GetPosFormatString( std::u16string_view sFormatStrg, bool 
& bFound );
+static OUString GetNegFormatString( std::u16string_view sFormatStrg, bool 
& bFound );
+static OUString Get0FormatString( std::u16string_view sFormatStrg, bool & 
bFound );
+static OUString GetNullFormatString( std::u16string_view sFormatStrg, bool 
& bFound );
 static void AnalyseFormatString( const OUString& sFormatStrg,
  short& nNoOfDigitsLeft, 
short& nNoOfDigitsRight,
  short& 
nNoOfOptionalDigitsLeft,
diff --git a/basic/source/sbx/sbxform.cxx b/basic/source/sbx/sbxform.cxx
index ef273c1f392b..4bd0c09ac99f 100644
--- a/basic/source/sbx/sbxform.cxx
+++ b/basic/source/sbx/sbxform.cxx
@@ -296,71 +296,71 @@ short SbxBasicFormater::GetDigitAtPosExpScan( double 
dNewExponent, short nPos,
 
 // Copies the respective part of the format-string, if existing, and returns 
it.
 // So a new string is created, which has to be freed by the caller later.
-OUString SbxBasicFormater::GetPosFormatString( const OUString& sFormatStrg, 
bool & bFound )
+OUString SbxBasicFormater::GetPosFormatString( std::u16string_view 
sFormatStrg, bool & bFound )
 {
 bFound = false; // default...
-sal_Int32 nPos = sFormatStrg.indexOf( FORMAT_SEPARATOR );
+size_t nPos = sFormatStrg.find( FORMAT_SEPARATOR );
 
-if( nPos >= 0 )
+if( nPos != std::u16string_view::npos )
 {
 bFound = true;
 // the format-string for positive numbers is
 // everything before the first ';'
-return sFormatStrg.copy( 0,nPos );
+return 

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

2021-09-15 Thread Noel Grandin (via logerrit)
 basic/inc/sbobjmod.hxx  |2 +-
 basic/inc/sbprop.hxx|4 ++--
 basic/source/inc/dlgcont.hxx|6 +++---
 basic/source/inc/errobject.hxx  |2 +-
 basic/source/inc/namecont.hxx   |4 ++--
 basic/source/inc/propacc.hxx|2 +-
 basic/source/inc/sbintern.hxx   |   10 +-
 basic/source/inc/sbjsmeth.hxx   |2 +-
 basic/source/inc/sbjsmod.hxx|2 +-
 basic/source/inc/sbunoobj.hxx   |   22 +++---
 basic/source/inc/scriptcont.hxx |6 +++---
 basic/source/inc/stdobj.hxx |2 +-
 basic/source/inc/symtbl.hxx |4 ++--
 13 files changed, 34 insertions(+), 34 deletions(-)

New commits:
commit 270bb6ef005c7b8932dfac0b801bfe65a2fb966c
Author: Noel Grandin 
AuthorDate: Wed Sep 15 14:27:31 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Sep 15 18:57:42 2021 +0200

loplugin:finalclasses in basic

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

diff --git a/basic/inc/sbobjmod.hxx b/basic/inc/sbobjmod.hxx
index 7cfa0cd81f9b..1a2a87cc5856 100644
--- a/basic/inc/sbobjmod.hxx
+++ b/basic/inc/sbobjmod.hxx
@@ -80,7 +80,7 @@ public:
 class SbUserFormModuleInstance* CreateInstance();
 };
 
-class SbUserFormModuleInstance : public SbUserFormModule
+class SbUserFormModuleInstance final : public SbUserFormModule
 {
 SbUserFormModule* m_pParentModule;
 
diff --git a/basic/inc/sbprop.hxx b/basic/inc/sbprop.hxx
index e554267f9e0b..8c185cc8a474 100644
--- a/basic/inc/sbprop.hxx
+++ b/basic/inc/sbprop.hxx
@@ -24,7 +24,7 @@
 
 class SbModule;
 
-class SbProperty : public SbxProperty
+class SbProperty final : public SbxProperty
 {
 friend class SbiFactory;
 friend class SbModule;
@@ -39,7 +39,7 @@ public:
 
 typedef tools::SvRef SbPropertyRef;
 
-class SbProcedureProperty : public SbxProperty
+class SbProcedureProperty final : public SbxProperty
 {
 bool mbSet; // Flag for set command
 
diff --git a/basic/source/inc/dlgcont.hxx b/basic/source/inc/dlgcont.hxx
index 4be36fec9160..58d1dbeb65f4 100644
--- a/basic/source/inc/dlgcont.hxx
+++ b/basic/source/inc/dlgcont.hxx
@@ -31,7 +31,7 @@ namespace basic
 {
 
 
-class SfxDialogLibraryContainer : public SfxLibraryContainer
+class SfxDialogLibraryContainer final : public SfxLibraryContainer
 {
 // Methods to distinguish between different library types
 virtual rtl::Reference implCreateLibrary( const OUString& 
aName ) override;
@@ -88,7 +88,7 @@ public:
 typedef ::cppu::ImplHelper1 <   css::resource::XStringResourceSupplier
 >   SfxDialogLibrary_BASE;
 
-class SfxDialogLibrary  :public SfxLibrary
+class SfxDialogLibrary final : public SfxLibrary
 ,public SfxDialogLibrary_BASE
 {
 SfxDialogLibraryContainer*
m_pParent;
@@ -140,7 +140,7 @@ public:
 
 static bool containsValidDialog( const css::uno::Any& aElement );
 
-protected:
+private:
 virtual bool isLibraryElementValid(const css::uno::Any& rElement) const 
override;
 };
 
diff --git a/basic/source/inc/errobject.hxx b/basic/source/inc/errobject.hxx
index c43e88667f80..db46f5e971e2 100644
--- a/basic/source/inc/errobject.hxx
+++ b/basic/source/inc/errobject.hxx
@@ -21,7 +21,7 @@
 #include "sbunoobj.hxx"
 #include 
 
-class SbxErrObject : public SbUnoObject
+class SbxErrObject final : public SbUnoObject
 {
 class ErrObject* m_pErrObject;
 css::uno::Reference m_xErr;
diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx
index 059d48354d72..096f614a84d2 100644
--- a/basic/source/inc/namecont.hxx
+++ b/basic/source/inc/namecont.hxx
@@ -62,7 +62,7 @@ typedef ::cppu::WeakImplHelper<
 css::util::XChangesNotifier > NameContainer_BASE;
 
 
-class NameContainer : public ::cppu::BaseMutex, public NameContainer_BASE
+class NameContainer final : public ::cppu::BaseMutex, public NameContainer_BASE
 {
 typedef std::unordered_map < OUString, sal_Int32 > NameContainerNameMap;
 
@@ -160,7 +160,7 @@ typedef ::comphelper::OListenerContainerBase<
 css::script::vba::XVBAScriptListener,
 css::script::vba::VBAScriptEvent > VBAScriptListenerContainer_BASE;
 
-class VBAScriptListenerContainer : public VBAScriptListenerContainer_BASE
+class VBAScriptListenerContainer final : public VBAScriptListenerContainer_BASE
 {
 public:
 explicit VBAScriptListenerContainer( ::osl::Mutex& rMutex );
diff --git a/basic/source/inc/propacc.hxx b/basic/source/inc/propacc.hxx
index f6df70797434..66dd26cefe63 100644
--- a/basic/source/inc/propacc.hxx
+++ b/basic/source/inc/propacc.hxx
@@ -32,7 +32,7 @@ typedef ::cppu::WeakImplHelper< css::beans::XPropertySet,
 css::beans::XPropertyAccess > 
SbPropertyValuesHelper;
 
 
-class SbPropertyValues: public SbPropertyValuesHelper
+class SbPropertyValues final : public SbPropertyValuesHelper
 {
 

[Libreoffice-commits] core.git: basic/inc basic/source include/basic

2021-05-10 Thread Noel Grandin (via logerrit)
 basic/inc/sb.hxx  |4 +--
 basic/inc/sbstdobj.hxx|2 -
 basic/inc/sbxfac.hxx  |4 +--
 basic/source/basmgr/basmgr.cxx|6 ++--
 basic/source/classes/image.cxx|4 +--
 basic/source/classes/sb.cxx   |   48 +++---
 basic/source/classes/sbunoobj.cxx |   10 +++
 basic/source/classes/sbxmod.cxx   |   38 +-
 basic/source/comp/codegen.cxx |8 +-
 basic/source/comp/dim.cxx |4 +--
 basic/source/inc/sbintern.hxx |   20 +++
 basic/source/inc/sbunoobj.hxx |4 +--
 basic/source/runtime/runtime.cxx  |   22 -
 basic/source/runtime/stdobj1.cxx  |2 -
 basic/source/sbx/sbxarray.cxx |2 -
 basic/source/sbx/sbxbase.cxx  |   16 ++--
 basic/source/sbx/sbxobj.cxx   |   10 +++
 basic/source/sbx/sbxvalue.cxx |5 +++
 include/basic/sbmod.hxx   |2 -
 include/basic/sbx.hxx |2 -
 include/basic/sbxcore.hxx |   12 +
 21 files changed, 111 insertions(+), 114 deletions(-)

New commits:
commit 0afb2b63b38dff138e66f4ac8afed60911cb6aad
Author: Noel Grandin 
AuthorDate: Mon May 10 14:14:49 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon May 10 15:14:48 2021 +0200

fix some leaks in basic

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

diff --git a/basic/inc/sb.hxx b/basic/inc/sb.hxx
index f94c52a6e045..19a591219d11 100644
--- a/basic/inc/sb.hxx
+++ b/basic/inc/sb.hxx
@@ -22,8 +22,8 @@
 #include 
 
 // create object from user-type  (+StringID+StringID)
-SbxObject* createUserTypeImpl(const OUString& rClassName);
+SbxObjectRef createUserTypeImpl(const OUString& rClassName);
 
-SbxObject* cloneTypeObjectImpl(const SbxObject& rTypeObj);
+SbxObjectRef cloneTypeObjectImpl(const SbxObject& rTypeObj);
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/inc/sbstdobj.hxx b/basic/inc/sbstdobj.hxx
index 001e332ae245..69db5c9ba9d5 100644
--- a/basic/inc/sbstdobj.hxx
+++ b/basic/inc/sbstdobj.hxx
@@ -28,7 +28,7 @@ class SbStdFactory final : public SbxFactory
 public:
 SbStdFactory();
 
-virtual SbxObject*  CreateObject( const OUString& rClassName ) override;
+virtual SbxObjectRef  CreateObject( const OUString& rClassName ) override;
 };
 
 class SbStdPicture final : public SbxObject
diff --git a/basic/inc/sbxfac.hxx b/basic/inc/sbxfac.hxx
index 28257b17a6d7..ab0736f3006e 100644
--- a/basic/inc/sbxfac.hxx
+++ b/basic/inc/sbxfac.hxx
@@ -29,8 +29,8 @@ class SbxFactory
 public:
 virtual ~SbxFactory();
 SbxFactory() {}
-virtual SbxBase* Create(sal_uInt16 nSbxId, sal_uInt32);
-virtual SbxObject* CreateObject(const OUString&);
+virtual SbxBaseRef Create(sal_uInt16 nSbxId, sal_uInt32);
+virtual SbxObjectRef CreateObject(const OUString&);
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 41882928a81d..1cbd407f2171 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -1784,12 +1784,12 @@ static uno::Sequence< sal_Int8 > implGetDialogData( 
SbxObject* pDialog )
 return aData;
 }
 
-static SbxObject* implCreateDialog( const uno::Sequence< sal_Int8 >& aData )
+static SbxObjectRef implCreateDialog( const uno::Sequence< sal_Int8 >& aData )
 {
 sal_Int8* pData = const_cast< uno::Sequence< sal_Int8 >& 
>(aData).getArray();
 SvMemoryStream aMemStream( pData, aData.getLength(), StreamMode::READ );
-SbxBase* pBase = SbxBase::Load( aMemStream );
-return dynamic_cast(pBase);
+SbxBaseRef pBase = SbxBase::Load( aMemStream );
+return dynamic_cast(pBase.get());
 }
 
 // HACK! Because this value is defined in basctl/inc/vcsbxdef.hxx
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index ea93303e41c8..52aee6636c79 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -308,8 +308,8 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
 SbxObject* pNestedTypeObj = static_cast< 
SbxObject* >( rTypes->Find( aNestedTypeName, SbxClassType::Object ) );
 if (pNestedTypeObj)
 {
-SbxObject* pCloneObj = 
cloneTypeObjectImpl( *pNestedTypeObj );
-pTypeElem->PutObject( pCloneObj );
+SbxObjectRef pCloneObj = 
cloneTypeObjectImpl( *pNestedTypeObj );
+pTypeElem->PutObject( pCloneObj.get() );
 }
 }
 else
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 

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

2020-07-30 Thread Noel Grandin (via logerrit)
 basic/inc/sbxbase.hxx|7 ++--
 basic/source/classes/sb.cxx  |   55 +++
 basic/source/inc/sbintern.hxx|   37 +++---
 basic/source/runtime/basrdll.cxx |5 +++
 basic/source/sbx/sbxbase.cxx |   13 -
 5 files changed, 64 insertions(+), 53 deletions(-)

New commits:
commit 231e1e416c039d1f9724962a89cf0573a3db48a2
Author: Noel Grandin 
AuthorDate: Wed Jul 29 20:41:48 2020 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 30 10:10:22 2020 +0200

fix shutdown crash in basic

another change I am working on slightly tweaks the shutdown ordering
and exposes this problem where two classes both think they own
the same object.

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

diff --git a/basic/inc/sbxbase.hxx b/basic/inc/sbxbase.hxx
index 269f6029a55a..361dd52bd691 100644
--- a/basic/inc/sbxbase.hxx
+++ b/basic/inc/sbxbase.hxx
@@ -38,9 +38,8 @@ struct SbxAppData
 {
 ErrCode eErrCode;  // Error code
 SbxVariableRef  m_aGlobErr; // Global error object
-std::vector>
-m_Factories;
-tools::SvRef mrImplRepository;
+std::vector m_Factories; // these are owned by
+tools::SvRef  mrImplRepository;
 
 // Pointer to Format()-Command helper class
 std::unique_ptr   pBasicFormater;
@@ -55,6 +54,8 @@ struct SbxAppData
 };
 
 SbxAppData& GetSbxData_Impl();
+/** returns true if the SbxAppData is still valid, used to check if we are in 
shutdown. */
+bool IsSbxData_Impl();
 
 #endif // INCLUDED_BASIC_INC_SBXBASE_HXX
 
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 1de6c8203426..c9f34e90ae16 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -463,14 +463,6 @@ SbxObject* SbiFactory::CreateObject( const OUString& 
rClass )
 }
 
 
-// Factory class to create OLE objects
-class SbOLEFactory : public SbxFactory
-{
-public:
-virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 ) override;
-virtual SbxObject* CreateObject( const OUString& ) override;
-};
-
 SbxBase* SbOLEFactory::Create( sal_uInt16, sal_uInt32 )
 {
 // Not supported
@@ -486,13 +478,6 @@ SbxObject* SbOLEFactory::CreateObject( const OUString& 
rClassName )
 
 // SbFormFactory, show user forms by: dim as new 
 
-class SbFormFactory : public SbxFactory
-{
-public:
-virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 ) override;
-virtual SbxObject* CreateObject( const OUString& ) override;
-};
-
 SbxBase* SbFormFactory::Create( sal_uInt16, sal_uInt32 )
 {
 // Not supported
@@ -587,14 +572,6 @@ SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj )
 return pRet;
 }
 
-// Factory class to create user defined objects (type command)
-class SbTypeFactory : public SbxFactory
-{
-public:
-virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 ) override;
-virtual SbxObject* CreateObject( const OUString& ) override;
-};
-
 SbxBase* SbTypeFactory::Create( sal_uInt16, sal_uInt32 )
 {
 // Not supported
@@ -922,14 +899,14 @@ StarBASIC::StarBASIC( StarBASIC* p, bool bIsDocBasic  )
 {
 GetSbData()->pSbFac.reset( new SbiFactory );
 AddFactory( GetSbData()->pSbFac.get() );
-GetSbData()->pTypeFac = new SbTypeFactory;
-AddFactory( GetSbData()->pTypeFac );
-GetSbData()->pClassFac = new SbClassFactory;
-AddFactory( GetSbData()->pClassFac );
-GetSbData()->pOLEFac = new SbOLEFactory;
-AddFactory( GetSbData()->pOLEFac );
-GetSbData()->pFormFac = new SbFormFactory;
-AddFactory( GetSbData()->pFormFac );
+GetSbData()->pTypeFac.reset(new SbTypeFactory);
+AddFactory( GetSbData()->pTypeFac.get() );
+GetSbData()->pClassFac.reset(new SbClassFactory);
+AddFactory( GetSbData()->pClassFac.get() );
+GetSbData()->pOLEFac.reset(new SbOLEFactory);
+AddFactory( GetSbData()->pOLEFac.get() );
+GetSbData()->pFormFac.reset(new SbFormFactory);
+AddFactory( GetSbData()->pFormFac.get() );
 GetSbData()->pUnoFac.reset( new SbUnoFactory );
 AddFactory( GetSbData()->pUnoFac.get() );
 }
@@ -963,14 +940,14 @@ StarBASIC::~StarBASIC()
 GetSbData()->pSbFac.reset();
 RemoveFactory( GetSbData()->pUnoFac.get() );
 GetSbData()->pUnoFac.reset();
-RemoveFactory( GetSbData()->pTypeFac );
-delete GetSbData()->pTypeFac; GetSbData()->pTypeFac = nullptr;
-RemoveFactory( GetSbData()->pClassFac );
-delete GetSbData()->pClassFac; GetSbData()->pClassFac = nullptr;
-RemoveFactory( GetSbData()->pOLEFac );
-delete GetSbData()->pOLEFac; GetSbData()->pOLEFac = nullptr;
-RemoveFactory( GetSbData()->pFormFac );
-delete GetSbData()->pFormFac; GetSbData()->pFormFac = nullptr;
+

[Libreoffice-commits] core.git: basic/inc basic/source include/basic solenv/clang-format

2020-02-08 Thread Noel Grandin (via logerrit)
 basic/inc/pch/precompiled_sb.hxx |6 +++---
 basic/inc/sbprop.hxx |2 +-
 basic/inc/sbstdobj.hxx   |2 +-
 basic/inc/sbxfac.hxx |5 +
 basic/inc/sbxform.hxx|6 +-
 basic/inc/sbxprop.hxx|6 +-
 basic/source/classes/image.cxx   |2 +-
 basic/source/inc/sbintern.hxx|2 +-
 basic/source/inc/sbunoobj.hxx|4 ++--
 basic/source/sbx/sbxbase.cxx |6 +++---
 basic/source/sbx/sbxform.cxx |2 +-
 basic/source/sbx/sbxobj.cxx  |2 +-
 basic/source/sbx/sbxscan.cxx |2 +-
 solenv/clang-format/blacklist|6 +++---
 14 files changed, 21 insertions(+), 32 deletions(-)

New commits:
commit a2f62a861ba7036e689070c47f72214b1bdd49d4
Author: Noel Grandin 
AuthorDate: Fri Feb 7 11:26:22 2020 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 8 13:21:31 2020 +0100

move some headers inside basic

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

diff --git a/basic/inc/pch/precompiled_sb.hxx b/basic/inc/pch/precompiled_sb.hxx
index dfbb81021c30..a39acef6f126 100644
--- a/basic/inc/pch/precompiled_sb.hxx
+++ b/basic/inc/pch/precompiled_sb.hxx
@@ -109,11 +109,11 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
+#include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/basic/inc/sbprop.hxx b/basic/inc/sbprop.hxx
index 383b4d914e2a..bd4a8b117c54 100644
--- a/basic/inc/sbprop.hxx
+++ b/basic/inc/sbprop.hxx
@@ -20,7 +20,7 @@
 #ifndef INCLUDED_BASIC_INC_SBPROP_HXX
 #define INCLUDED_BASIC_INC_SBPROP_HXX
 
-#include 
+#include "sbxprop.hxx"
 #include 
 
 class SbModule;
diff --git a/basic/inc/sbstdobj.hxx b/basic/inc/sbstdobj.hxx
index 965940c8ddcd..ad242dfb1489 100644
--- a/basic/inc/sbstdobj.hxx
+++ b/basic/inc/sbstdobj.hxx
@@ -22,7 +22,7 @@
 
 #include 
 #include 
-#include 
+#include "sbxfac.hxx"
 #include 
 
 class SbStdFactory final : public SbxFactory
diff --git a/include/basic/sbxfac.hxx b/basic/inc/sbxfac.hxx
similarity index 94%
rename from include/basic/sbxfac.hxx
rename to basic/inc/sbxfac.hxx
index a525aa55241a..e9b130eec192 100644
--- a/include/basic/sbxfac.hxx
+++ b/basic/inc/sbxfac.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASIC_SBXFAC_HXX
-#define INCLUDED_BASIC_SBXFAC_HXX
+#pragma once
 
 #include 
 #include 
@@ -35,6 +34,4 @@ public:
 virtual SbxObject* CreateObject( const OUString& );
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbxform.hxx b/basic/inc/sbxform.hxx
similarity index 98%
rename from include/basic/sbxform.hxx
rename to basic/inc/sbxform.hxx
index b07a1945c7c7..94dece69832c 100644
--- a/include/basic/sbxform.hxx
+++ b/basic/inc/sbxform.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASIC_SBXFORM_HXX
-#define INCLUDED_BASIC_SBXFORM_HXX
+#pragma once
 
 
 // Implementation class for Basic command: Format$( d,formatStr )
@@ -69,7 +68,6 @@
 
 #include 
 #include 
-#include 
 
 class SbxBasicFormater {
   public:
@@ -153,6 +151,4 @@ class SbxBasicFormater {
 short   nExpExp;// the number of digits in the exponent
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbxprop.hxx b/basic/inc/sbxprop.hxx
similarity index 92%
rename from include/basic/sbxprop.hxx
rename to basic/inc/sbxprop.hxx
index 34557ad599d8..0c57d0b72799 100644
--- a/include/basic/sbxprop.hxx
+++ b/basic/inc/sbxprop.hxx
@@ -17,11 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASIC_SBXPROP_HXX
-#define INCLUDED_BASIC_SBXPROP_HXX
+#pragma once
 
 #include 
-#include 
 
 class SbxProperty : public SbxVariable
 {
@@ -36,6 +34,4 @@ public:
 };
 
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index 959681636dcd..a7f6c75a4bdc 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -23,7 +23,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/basic/source/inc/sbintern.hxx b/basic/source/inc/sbintern.hxx
index 61b2953486ed..75e3ede9a6bb 100644
--- a/basic/source/inc/sbintern.hxx
+++ b/basic/source/inc/sbintern.hxx
@@ -22,7 +22,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx
index 17440c70649d..1d6d9de1d5eb 100644
--- a/basic/source/inc/sbunoobj.hxx
+++ b/basic/source/inc/sbunoobj.hxx
@@ -21,8 +21,8 @@
 
 #include 
 #include 
-#include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/basic/source/sbx/sbxbase.cxx 

[Libreoffice-commits] core.git: basic/inc basic/source dbaccess/source include/basic include/unotest sfx2/source unotest/source

2019-12-29 Thread Mike Kaganski (via logerrit)
 basic/inc/sbxbase.hxx  |1 
 basic/source/basmgr/basicmanagerrepository.cxx |   20 -
 basic/source/runtime/basrdll.cxx   |   53 +++--
 basic/source/sbx/sbxbase.cxx   |3 +
 dbaccess/source/core/inc/databasecontext.hxx   |   10 
 include/basic/basrdll.hxx  |7 +--
 include/unotest/macros_test.hxx|   11 +
 sfx2/source/appl/app.cxx   |7 ---
 sfx2/source/appl/appdata.cxx   |7 +++
 unotest/source/cpp/macros_test.cxx |8 +++
 10 files changed, 92 insertions(+), 35 deletions(-)

New commits:
commit 8cce131dcc1803ac95f3079098be767662fcca09
Author: Mike Kaganski 
AuthorDate: Sat Dec 28 03:49:16 2019 +0300
Commit: Mike Kaganski 
CommitDate: Sun Dec 29 15:46:16 2019 +0100

Avoid crash in shutdown when accessing already destroyed BASIC_DLL

... in ImplRepository::~ImplRepository.

Running on Windows:
make UITest_manual_tests 
UITEST_TEST_NAME=calc.ManualCalcTests.test_cell_recalc

fails:

  ...
  Execution time for calc.ManualCalcTests.test_cell_recalc: 8.876
  tearDown: calling terminate()...
  ...done
  ERROR

  ==
  ERROR: test_cell_recalc (calc.ManualCalcTests)
  --
  Traceback (most recent call last):
File "C:\lo\src\core\uitest\uitest\framework.py", line 46, in tearDown
  self.connection.tearDown()
File "C:\lo\src\core\uitest\libreoffice\connection.py", line 178, in 
tearDown
  self.connection.tearDown()
File "C:\lo\src\core\uitest\libreoffice\connection.py", line 138, in 
tearDown
  raise Exception("Exit status indicates failure: " + str(ret))
  Exception: Exit status indicates failure: 3221225477

  --
  Ran 1 test in 131.616s

  FAILED (errors=1)
  Tests run: 1
  Tests failed: 0
  Tests errors: 1
  Tests skipped: 0

The call stack at the point of failure is

  
sblo.dll!std::unique_ptr>::operator*()
 Line 1886
  sblo.dll!GetSbxData_Impl() Line 110
  sblo.dll!SbxBase::RemoveFactory(const SbxFactory * pFac) Line 122
  sblo.dll!StarBASIC::~StarBASIC() Line 964
  sblo.dll!StarBASIC::`vbase destructor'()
  sblo.dll!StarBASIC::`vector deleting destructor'(unsigned int)
  tllo.dll!SvRefBase::ReleaseRef() Line 163
  sblo.dll!tools::SvRef::~SvRef() Line 56
  sblo.dll!BasicLibInfo::~BasicLibInfo()
  sblo.dll!BasicLibInfo::`scalar deleting destructor'(unsigned int)
  sblo.dll!std::default_delete::operator()(BasicLibInfo * 
_Ptr) Line 1765
  
sblo.dll!std::unique_ptr>::~unique_ptr>()
 Line 1875
  
sblo.dll!std::unique_ptr>::`scalar
 deleting destructor'(unsigned int)
  
sblo.dll!std::_Default_allocator_traits>>>::destroy>>(std::allocator>>
 & __formal, std::unique_ptr> * 
const _Ptr) Line 677
  
sblo.dll!std::_Destroy_range>>>(std::unique_ptr>
 * _First, std::unique_ptr> * 
const _Last, 
std::allocator>> 
& _Al) Line 951
  
sblo.dll!std::vector>,std::allocator>>>::_Destroy(std::unique_ptr>
 * _First, std::unique_ptr> * 
_Last) Line 1616
  
sblo.dll!std::vector>,std::allocator>>>::_Tidy()
 Line 1698
  
sblo.dll!std::vector>,std::allocator>>>::~vector>,std::allocator>>>()
 Line 674
  sblo.dll!BasicManagerImpl::~BasicManagerImpl()
  sblo.dll!BasicManagerImpl::`scalar deleting destructor'(unsigned int)
  
sblo.dll!std::default_delete::operator()(BasicManagerImpl * 
_Ptr) Line 1765
  
sblo.dll!std::unique_ptr>::~unique_ptr>()
 Line 1875
  sblo.dll!BasicManager::~BasicManager() Line 824
  sblo.dll!BasicManager::`vector deleting destructor'(unsigned int)
  sblo.dll!std::default_delete::operator()(BasicManager * 
_Ptr) Line 1765
  
sblo.dll!std::unique_ptr>::~unique_ptr>()
 Line 1875
  
sblo.dll!std::pair
 const 
,std::unique_ptr>>::~pair
 const ,std::unique_ptr>>()
  
sblo.dll!std::pair
 const 
,std::unique_ptr>>::`scalar 
deleting destructor'(unsigned int)
  
sblo.dll!std::_Default_allocator_traits
 const ,std::unique_ptr>>,void 
*>>>::destroy
 const 
,std::unique_ptr>>>(std::allocator
 const ,std::unique_ptr>>,void 
*>> & __formal, 
std::pair const 
,std::unique_ptr>> * const _Ptr) 
Line 677
  
sblo.dll!std::_Tree_node
 const ,std::unique_ptr>>,void 
*>::_Freenode
 const ,std::unique_ptr>>,void 
*>>>(std::allocator
 const ,std::unique_ptr>>,void 
*>> & _Al, 
std::_Tree_node
 const ,std::unique_ptr>>,void 
*> * _Ptr) Line 379
  
sblo.dll!std::_Tree,std::unique_ptr>,std::less>,std::allocator
 const 
,std::unique_ptr>>>,0>>::_Erase_unchecked(std::_Tree_unchecked_const_iterator
 const 
,std::unique_ptr,std::_Iterator_base0>
 _Where) 

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

2019-12-20 Thread Mike Kaganski (via logerrit)
 basic/inc/sbxbase.hxx  |4 
 basic/source/classes/errobject.cxx |   12 ++--
 2 files changed, 14 insertions(+), 2 deletions(-)

New commits:
commit 3ebf6a090b227c0097ff8668fe023e7bdbdadc5d
Author: Mike Kaganski 
AuthorDate: Fri Dec 20 12:49:04 2019 +0300
Commit: Mike Kaganski 
CommitDate: Sat Dec 21 08:12:38 2019 +0100

Avoid crash in shutdown when accessing already destroyed BASIC_DLL

... as seen in 
https://ci.libreoffice.org/job/gerrit_linux_gcc_release/48425/console

The problem was that SbxErrObject::getErrObject created a static object
which called GetSbxData_Impl() in its destructor, which in turn accessed
BASIC_DLL, which was invalidated by deleting BasicDLL objects either in
SfxApplication::~SfxApplication or in MacroSnippet::~MacroSnippet, thus
already invalid when static was destroyed.

So fix this by creating the global error object in the SbxAppData, not
as function-local static, so that its lifetime is limited to the data.

The crash happened also on Windows, but was somehow masked (possibly by
custom error handler?), with this call stack:


sblo.dll!std::unique_ptr>::operator*()
 Line 1886
at C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\memory(1886)
sblo.dll!GetSbxData_Impl() Line 110
at C:\lo\src\core\basic\source\runtime\basrdll.cxx(110)
sblo.dll!SbxBase::GetError() Line 96
at C:\lo\src\core\basic\source\sbx\sbxbase.cxx(96)
sblo.dll!SbxValue::Put(const SbxValues & rVal) Line 414
at C:\lo\src\core\basic\source\sbx\sbxvalue.cxx(414)
sblo.dll!SbxValue::Clear() Line 179
at C:\lo\src\core\basic\source\sbx\sbxvalue.cxx(179)
sblo.dll!SbxValue::~SbxValue() Line 139
at C:\lo\src\core\basic\source\sbx\sbxvalue.cxx(139)
sblo.dll!SbxVariable::~SbxVariable() Line 125
at C:\lo\src\core\basic\source\sbx\sbxvar.cxx(125)
sblo.dll!SbxProperty::~SbxProperty() Line 861
at C:\lo\src\core\basic\source\sbx\sbxobj.cxx(861)
sblo.dll!SbUnoProperty::~SbUnoProperty() Line 2591
at C:\lo\src\core\basic\source\classes\sbunoobj.cxx(2591)
sblo.dll!SbUnoProperty::`vbase destructor'()
sblo.dll!SbUnoProperty::`scalar deleting destructor'(unsigned int)
tllo.dll!SvRefBase::ReleaseRef() Line 163
at C:\lo\src\core\include\tools\ref.hxx(163)
sblo.dll!tools::SvRef::~SvRef() Line 56
at C:\lo\src\core\include\tools\ref.hxx(56)
sblo.dll!SbxVarEntry::~SbxVarEntry()
sblo.dll!SbxVarEntry::`scalar deleting destructor'(unsigned int)

sblo.dll!std::_Default_allocator_traits>::destroy(std::allocator
 & __formal, SbxVarEntry * const _Ptr) Line 677
at C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\xmemory(677)
sblo.dll!std::_Destroy_range>(SbxVarEntry * 
_First, SbxVarEntry * const _Last, std::allocator & _Al) Line 951
at C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\xmemory(951)

sblo.dll!std::vector>::_Destroy(SbxVarEntry
 * _First, SbxVarEntry * _Last) Line 1616
at C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\vector(1616)
sblo.dll!std::vector>::_Tidy() Line 
1698
at C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\vector(1698)

sblo.dll!std::vector>::~vector>()
 Line 674
at C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\vector(674)
sblo.dll!SbxArray::~SbxArray() Line 75
at C:\lo\src\core\basic\source\sbx\sbxarray.cxx(75)
sblo.dll!SbxArray::`vbase destructor'()
sblo.dll!SbxArray::`vector deleting destructor'(unsigned int)
tllo.dll!SvRefBase::ReleaseRef() Line 163
at C:\lo\src\core\include\tools\ref.hxx(163)
sblo.dll!tools::SvRef::~SvRef() Line 56
at C:\lo\src\core\include\tools\ref.hxx(56)
sblo.dll!SbxObject::~SbxObject() Line 111
at C:\lo\src\core\basic\source\sbx\sbxobj.cxx(111)
sblo.dll!SbUnoObject::~SbUnoObject() Line 2387
at C:\lo\src\core\basic\source\classes\sbunoobj.cxx(2387)
sblo.dll!SbxErrObject::~SbxErrObject() Line 183
at C:\lo\src\core\basic\source\classes\errobject.cxx(183)
sblo.dll!SbxErrObject::`vbase destructor'()
sblo.dll!SbxErrObject::`scalar deleting destructor'(unsigned int)
tllo.dll!SvRefBase::ReleaseRef() Line 163
at C:\lo\src\core\include\tools\ref.hxx(163)
sblo.dll!tools::SvRef::~SvRef() Line 56
at C:\lo\src\core\include\tools\ref.hxx(56)
sblo.dll!`SbxErrObject::getErrObject'::`2'::`dynamic atexit destructor for 
'pGlobErr''()
ucrtbased.dll!_execute_onexit_table::__l2::() Line 206
at 

[Libreoffice-commits] core.git: basic/inc basic/source include/basic include/sfx2 include/sot include/svx include/vcl include/xmloff sc/inc sc/source sd/inc sd/source sfx2/inc sfx2/source vcl/inc xmls

2019-11-05 Thread Noel Grandin (via logerrit)
 basic/inc/sbobjmod.hxx  |6 +--
 basic/inc/sbstdobj.hxx  |8 ++--
 basic/source/inc/sbintern.hxx   |2 -
 include/basic/sbmeth.hxx|2 -
 include/basic/sbx.hxx   |6 +--
 include/basic/sbxfac.hxx|2 -
 include/basic/sbxform.hxx   |   36 +-
 include/basic/sbxprop.hxx   |2 -
 include/basic/sbxvar.hxx|2 -
 include/sfx2/charmapcontrol.hxx |2 -
 include/sfx2/emojicontrol.hxx   |2 -
 include/sfx2/templatedlg.hxx|2 -
 include/sfx2/templatelocalview.hxx  |2 -
 include/sfx2/thumbnailview.hxx  |   20 +-
 include/sot/stg.hxx |2 -
 include/svx/sdginitm.hxx|2 -
 include/svx/svddrag.hxx |2 -
 include/svx/svddrgmt.hxx|2 -
 include/svx/svdhdl.hxx  |2 -
 include/svx/svdobj.hxx  |2 -
 include/svx/sxmtfitm.hxx|4 +-
 include/svx/sxmtritm.hxx|2 -
 include/vcl/fixed.hxx   |2 -
 include/vcl/salnativewidgets.hxx|6 +--
 include/vcl/svlbitm.hxx |2 -
 include/vcl/treelistbox.hxx |2 -
 include/vcl/uitest/uiobject.hxx |6 +--
 include/xmloff/xmlmetae.hxx |8 ++--
 sc/inc/chartarr.hxx |2 -
 sc/inc/detfunc.hxx  |2 -
 sc/inc/dpfilteredcache.hxx  |2 -
 sc/inc/dptabsrc.hxx |4 +-
 sc/inc/formularesult.hxx|   12 +++---
 sc/inc/inputopt.hxx |2 -
 sc/inc/postit.hxx   |2 -
 sc/inc/table.hxx|2 -
 sc/inc/token.hxx|8 ++--
 sc/source/core/inc/grouptokenconverter.hxx  |2 -
 sc/source/core/inc/interpre.hxx |4 +-
 sc/source/ui/inc/anyrefdg.hxx   |2 -
 sc/source/ui/inc/condformatdlg.hxx  |4 +-
 sc/source/ui/inc/csvruler.hxx   |   40 ++--
 sc/source/ui/inc/datatableview.hxx  |2 -
 sc/source/ui/inc/docsh.hxx  |2 -
 sc/source/ui/inc/hdrcont.hxx|2 -
 sc/source/ui/inc/protectiondlg.hxx  |2 -
 sc/source/ui/inc/reffact.hxx|2 -
 sc/source/ui/inc/sharedocdlg.hxx|2 -
 sd/inc/sdabstdlg.hxx|2 -
 sd/source/ui/inc/docprev.hxx|2 -
 sd/source/ui/inc/ins_paste.hxx  |2 -
 sfx2/inc/autoredactdialog.hxx   |2 -
 sfx2/inc/bluthsndapi.hxx|2 -
 sfx2/source/appl/shutdownicon.hxx   |2 -
 vcl/inc/headless/svpdummies.hxx |4 +-
 vcl/inc/headless/svpframe.hxx   |2 -
 vcl/inc/svmconverter.hxx|4 +-
 vcl/inc/unx/i18n_im.hxx |2 -
 vcl/inc/unx/i18n_xkb.hxx|2 -
 vcl/inc/unx/saldisp.hxx |4 +-
 vcl/inc/unx/sm.hxx  |2 -
 xmlsecurity/inc/framework/saxeventkeeperimpl.hxx|2 -
 xmlsecurity/inc/framework/securityengine.hxx|2 -
 xmlsecurity/inc/framework/signaturecreatorimpl.hxx  |2 -
 xmlsecurity/inc/framework/signatureengine.hxx   |2 -
 xmlsecurity/inc/framework/signatureverifierimpl.hxx |2 -
 66 files changed, 140 insertions(+), 140 deletions(-)

New commits:
commit c02c4df9414ed2bef96565522238ca05013d3ac3
Author: Noel Grandin 
AuthorDate: Mon Nov 4 11:11:50 2019 +0200
Commit: Noel Grandin 
CommitDate: Tue Nov 5 12:18:29 2019 +0100

make some classes module-private

Change-Id: Ice9a57eedb166672dbdfae6da2a172ab77566a19
Reviewed-on: https://gerrit.libreoffice.org/81983
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/basic/inc/sbobjmod.hxx b/basic/inc/sbobjmod.hxx
index 64c5784d7b0b..5d2561fd84df 100644
--- a/basic/inc/sbobjmod.hxx
+++ b/basic/inc/sbobjmod.hxx
@@ -31,7 +31,7 @@
 
 // Basic-Module for excel object.
 
-class BASIC_DLLPUBLIC SbObjModule : public SbModule
+class SbObjModule : public SbModule
 {
 protected:
 virtual ~SbObjModule() override;
@@ -50,7 

[Libreoffice-commits] core.git: basic/inc basic/source canvas/source chart2/source compilerplugins/clang connectivity/source cppcanvas/source cui/source dbaccess/source desktop/source drawinglayer/sou

2017-08-01 Thread Noel Grandin
 basic/inc/sbstdobj.hxx 
|   12 -
 basic/source/runtime/stdobj1.cxx   
|   25 +-
 canvas/source/tools/verifyinput.cxx
|9 
 
chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx
 |2 
 chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
|3 
 chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx
|2 
 chart2/source/controller/inc/MultipleChartConverters.hxx   
|1 
 chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
|1 
 chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx   
|3 
 chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
|3 
 chart2/source/controller/main/ChartController_Insert.cxx   
|5 
 chart2/source/controller/main/ChartController_Properties.cxx   
|2 
 chart2/source/controller/main/ChartController_Tools.cxx
|8 
 chart2/source/controller/sidebar/ChartElementsPanel.cxx
|2 
 chart2/source/controller/sidebar/ChartSeriesPanel.cxx  
|3 
 chart2/source/inc/AxisHelper.hxx   
|6 
 chart2/source/inc/ObjectIdentifier.hxx 
|8 
 chart2/source/inc/RegressionCurveHelper.hxx
|4 
 chart2/source/tools/AxisHelper.cxx 
|8 
 chart2/source/tools/ObjectIdentifier.cxx   
|   26 --
 chart2/source/tools/RegressionCurveHelper.cxx  
|5 
 chart2/source/view/charttypes/PieChart.cxx 
|   11 -
 chart2/source/view/charttypes/PieChart.hxx 
|1 
 compilerplugins/clang/checkunusedparams.cxx
|  105 --
 connectivity/source/drivers/hsqldb/HStorageAccess.cxx  
|   23 +-
 connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx
|9 
 connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx   
|   11 -
 connectivity/source/inc/hsqldb/HStorageAccess.hxx  
|8 
 cppcanvas/source/mtfrenderer/textaction.cxx
|5 
 cui/source/inc/swpossizetabpage.hxx
|4 
 cui/source/tabpages/swpossizetabpage.cxx   
|   32 +--
 dbaccess/source/core/dataaccess/ContentHelper.cxx  
|4 
 dbaccess/source/core/inc/ContentHelper.hxx 
|3 
 dbaccess/source/ui/browser/genericcontroller.cxx   
|   16 -
 desktop/source/lib/init.cxx
|6 
 desktop/source/lib/lokinteractionhandler.cxx   
|1 
 desktop/source/lib/lokinteractionhandler.hxx   
|1 
 drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx 
|2 
 editeng/source/editeng/impedit2.cxx
|6 
 filter/source/msfilter/svdfppt.cxx 
|4 
 filter/source/svg/impsvgdialog.cxx 
|   32 +--
 filter/source/svg/parserfragments.cxx  
|8 
 filter/source/svg/svgreader.cxx
|   34 ---
 framework/inc/dispatch/mailtodispatcher.hxx
|3 
 framework/inc/dispatch/servicehandler.hxx  
|3 
 framework/source/dispatch/mailtodispatcher.cxx 
|   13 -
 framework/source/dispatch/servicehandler.cxx   
|   13 -
 hwpfilter/source/drawing.h 
|   48 ++--
 include/canvas/verifyinput.hxx 
|   21 --
 include/oox/ole/axcontrol.hxx  
|4 
 include/oox/ppt/timenodelistcontext.hxx
|2 
 include/svtools/brwbox.hxx 
|1 
 include/svtools/htmlout.hxx
|6 
 include/svx/ruler.hxx  

[Libreoffice-commits] core.git: basic/inc basic/source compilerplugins/clang include/basic

2017-07-20 Thread Noel Grandin
 basic/inc/sbstdobj.hxx|6 +++---
 basic/source/basmgr/basmgr.cxx|6 +++---
 basic/source/classes/image.cxx|4 ++--
 basic/source/classes/sb.cxx   |4 ++--
 basic/source/classes/sbunoobj.cxx |   14 +++---
 basic/source/comp/codegen.cxx |4 ++--
 basic/source/inc/codegen.hxx  |4 ++--
 basic/source/inc/image.hxx|2 +-
 basic/source/inc/runtime.hxx  |8 
 basic/source/inc/sbunoobj.hxx |   10 +-
 basic/source/runtime/methods.cxx  |2 +-
 basic/source/runtime/runtime.cxx  |   16 
 basic/source/runtime/stdobj1.cxx  |6 +++---
 basic/source/sbx/sbxarray.cxx |2 +-
 basic/source/sbx/sbxbase.cxx  |2 +-
 basic/source/sbx/sbxdec.hxx   |2 +-
 basic/source/sbx/sbxobj.cxx   |2 +-
 basic/source/sbx/sbxvalue.cxx |2 +-
 compilerplugins/clang/constparams.cxx |4 
 include/basic/basmgr.hxx  |2 +-
 include/basic/sbstar.hxx  |2 +-
 include/basic/sbuno.hxx   |2 +-
 include/basic/sbx.hxx |2 +-
 include/basic/sbxcore.hxx |2 +-
 include/basic/sbxobj.hxx  |2 +-
 include/basic/sbxvar.hxx  |2 +-
 26 files changed, 59 insertions(+), 55 deletions(-)

New commits:
commit 6d829ae4f218b5d751cfc366f071fc6160c0787c
Author: Noel Grandin 
Date:   Thu Jul 20 10:08:03 2017 +0200

loplugin:constparams in basic

Change-Id: Idf55f63f2d56be4997a8cdc6afc5690eacac9a60
Reviewed-on: https://gerrit.libreoffice.org/40214
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/basic/inc/sbstdobj.hxx b/basic/inc/sbstdobj.hxx
index 210d3f7a26c4..34a6e49e7450 100644
--- a/basic/inc/sbstdobj.hxx
+++ b/basic/inc/sbstdobj.hxx
@@ -101,12 +101,12 @@ protected:
 virtual ~SbStdClipboard() override;
 virtual void   Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) 
override;
 
-static voidMethClear( SbxVariable* pVar, SbxArray* pPar_, bool bWrite 
);
+static voidMethClear( SbxVariable* pVar, SbxArray const * pPar_, bool 
bWrite );
 static voidMethGetData( SbxArray* pPar_, bool bWrite );
 static voidMethGetFormat( SbxVariable* pVar, SbxArray* pPar_, bool 
bWrite );
-static voidMethGetText( SbxVariable* pVar, SbxArray* pPar_, bool 
bWrite );
+static voidMethGetText( SbxVariable* pVar, SbxArray const * pPar_, 
bool bWrite );
 static voidMethSetData( SbxArray* pPar_, bool bWrite );
-static voidMethSetText( SbxArray* pPar_, bool bWrite );
+static voidMethSetText( SbxArray const * pPar_, bool bWrite );
 
 public:
 
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 464c10489b46..cc1e3d340503 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -131,7 +131,7 @@ public:
 
 static void insertLibraryImpl( const uno::Reference< 
script::XLibraryContainer >& xScriptCont, BasicManager* pMgr,
const uno::Any& aLibAny, const OUString& 
aLibName );
-static void addLibraryModulesImpl( BasicManager* pMgr, const 
uno::Reference< container::XNameAccess >& xLibNameAccess,
+static void addLibraryModulesImpl( BasicManager const * pMgr, const 
uno::Reference< container::XNameAccess >& xLibNameAccess,
const OUString& aLibName );
 
 
@@ -177,7 +177,7 @@ void BasMgrContainerListenerImpl::insertLibraryImpl( const 
uno::Reference< scrip
 }
 
 
-void BasMgrContainerListenerImpl::addLibraryModulesImpl( BasicManager* pMgr,
+void BasMgrContainerListenerImpl::addLibraryModulesImpl( BasicManager const * 
pMgr,
 const uno::Reference< container::XNameAccess >& xLibNameAccess, const 
OUString& aLibName )
 {
 uno::Sequence< OUString > aModuleNames = xLibNameAccess->getElementNames();
@@ -1367,7 +1367,7 @@ StarBASIC* BasicManager::CreateLibForLibContainer( const 
OUString& rLibName,
 }
 
 
-BasicLibInfo* BasicManager::FindLibInfo( StarBASIC* pBasic )
+BasicLibInfo* BasicManager::FindLibInfo( StarBASIC const * pBasic )
 {
 for (auto const& rpLib : mpImpl->aLibs)
 {
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index db06dc9b5d2b..7363fd5ad24f 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -77,7 +77,7 @@ void SbiImage::Clear()
 *
 **/
 
-bool SbiGood( SvStream& r )
+bool SbiGood( SvStream const & r )
 {
 return !r.IsEof() && r.GetError() == ERRCODE_NONE;
 }
@@ -618,7 +618,7 @@ void SbiImage::AddCode( char* p, sal_uInt32 s )
 }
 
 // Add user type
-void SbiImage::AddType(SbxObject* pObject)
+void SbiImage::AddType(SbxObject const * pObject)
 {
 if( !rTypes.is() )
 

[Libreoffice-commits] core.git: basic/inc basic/source chart2/inc cui/inc dbaccess/source desktop/source editeng/inc forms/inc include/basic include/editeng include/filter include/sfx2 include/sot inc

2017-04-27 Thread Chris Sherlock
 basic/inc/pch/precompiled_sb.hxx |2 +-
 basic/source/classes/sb.src  |7 +--
 basic/source/classes/sbunoobj.cxx|2 +-
 basic/source/runtime/ddectrl.cxx |2 +-
 basic/source/sbx/sbxbool.cxx |2 +-
 basic/source/sbx/sbxbyte.cxx |2 +-
 basic/source/sbx/sbxchar.cxx |2 +-
 basic/source/sbx/sbxcurr.cxx |2 +-
 basic/source/sbx/sbxdate.cxx |2 +-
 basic/source/sbx/sbxdbl.cxx  |2 +-
 basic/source/sbx/sbxdec.cxx  |2 +-
 basic/source/sbx/sbxexec.cxx |2 +-
 basic/source/sbx/sbxint.cxx  |2 +-
 basic/source/sbx/sbxlng.cxx  |2 +-
 basic/source/sbx/sbxscan.cxx |2 +-
 basic/source/sbx/sbxsng.cxx  |2 +-
 basic/source/sbx/sbxstr.cxx  |2 +-
 basic/source/sbx/sbxuint.cxx |2 +-
 basic/source/sbx/sbxulng.cxx |2 +-
 chart2/inc/pch/precompiled_chartcontroller.hxx   |2 +-
 chart2/inc/pch/precompiled_chartcore.hxx |2 +-
 cui/inc/pch/precompiled_cui.hxx  |2 +-
 dbaccess/source/core/dataaccess/ModelImpl.cxx|2 +-
 dbaccess/source/core/dataaccess/databasedocument.cxx |2 +-
 desktop/source/lib/lokinteractionhandler.hxx |2 +-
 editeng/inc/pch/precompiled_editeng.hxx  |2 +-
 forms/inc/pch/precompiled_frm.hxx|2 +-
 include/basic/sbmeth.hxx |2 +-
 include/basic/sbxdef.hxx |2 +-
 include/editeng/editerr.hxx  |2 +-
 include/filter/msfilter/msdffimp.hxx |2 +-
 include/filter/msfilter/svxmsbas.hxx |2 +-
 include/sfx2/app.hxx |2 +-
 include/sfx2/docinsert.hxx   |2 +-
 include/sfx2/filedlghelper.hxx   |2 +-
 include/sfx2/objsh.hxx   |2 +-
 include/sfx2/viewsh.hxx  |2 +-
 include/sot/storage.hxx  |2 +-
 include/svtools/sfxecode.hxx |2 +-
 include/svtools/soerr.hxx|2 +-
 include/svx/svxerr.hxx   |2 +-
 include/tools/stream.hxx |2 +-
 include/vcl/errcode.hxx  |4 ++--
 include/vcl/errinf.hxx   |2 +-
 include/vcl/print.hxx|2 +-
 reportdesign/inc/pch/precompiled_rptui.hxx   |2 +-
 sc/inc/pch/precompiled_sc.hxx|2 +-
 sc/inc/scerrors.hxx  |2 +-
 sc/inc/xmlwrap.hxx   |2 +-
 sd/inc/pch/precompiled_sd.hxx|2 +-
 sd/inc/pch/precompiled_sdui.hxx  |2 +-
 sd/inc/sderror.hxx   |2 +-
 sd/inc/sdxmlwrp.hxx  |2 +-
 sd/source/ui/inc/filedlg.hxx |2 +-
 sdext/source/pdfimport/misc/pwdinteract.cxx  |2 +-
 sfx2/source/inc/helper.hxx   |2 +-
 sfx2/source/inc/macroloader.hxx  |2 +-
 starmath/inc/pch/precompiled_sm.hxx  |2 +-
 svtools/inc/pch/precompiled_svt.hxx  |2 +-
 svx/inc/pch/precompiled_svx.hxx  |2 +-
 sw/inc/pch/precompiled_msword.hxx|2 +-
 sw/inc/pch/precompiled_sw.hxx|2 +-
 sw/inc/pch/precompiled_swui.hxx  |2 +-
 sw/inc/pch/precompiled_vbaswobj.hxx  |2 +-
 sw/inc/swerror.h |2 +-
 sw/qa/extras/uiwriter/uiwriter.cxx   |2 +-
 unotools/source/ucbhelper/ucblockbytes.hxx   |2 +-
 uui/source/iahndl-authentication.cxx |2 +-
 uui/source/iahndl.hxx|2 +-
 uui/source/ids.hrc   |2 +-
 vbahelper/inc/pch/precompiled_msforms.hxx|2 +-
 vbahelper/inc/pch/precompiled_vbahelper.hxx  |2 +-
 72 files changed, 77 insertions(+), 74 deletions(-)

New commits:
commit f9f045e7830d184497554e0e438cc478fa990eb6
Author: Chris Sherlock 
Date:   Mon Apr 24 01:06:41 2017 +1000

tools: move errcode.hxx to the vcl module

Change-Id: I17e5a033de5f0aeb0a726744f7b464cdab6e2ee3
Reviewed-on: https://gerrit.libreoffice.org/36854

[Libreoffice-commits] core.git: basic/inc basic/source include/basic

2016-08-29 Thread Arnaud Versini
 basic/inc/sbprop.hxx  |2 +-
 basic/source/inc/sbjsmeth.hxx |2 +-
 basic/source/inc/sbjsmod.hxx  |2 +-
 basic/source/sbx/sbxbase.cxx  |2 +-
 include/basic/sbmeth.hxx  |2 +-
 include/basic/sbmod.hxx   |2 +-
 include/basic/sbstar.hxx  |2 +-
 include/basic/sbx.hxx |8 
 include/basic/sbxcore.hxx |4 +---
 include/basic/sbxmeth.hxx |2 +-
 include/basic/sbxobj.hxx  |2 +-
 include/basic/sbxprop.hxx |2 +-
 include/basic/sbxvar.hxx  |4 ++--
 13 files changed, 17 insertions(+), 19 deletions(-)

New commits:
commit 301279ea15f0310367598300f884062333628767
Author: Arnaud Versini 
Date:   Sun Aug 28 11:52:53 2016 +0200

BASIC : Remove useless SbxBase::GetCreator

Change-Id: I3d9aa358ffaefc11b7d2427f2b567c360be2c667
Reviewed-on: https://gerrit.libreoffice.org/28434
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/basic/inc/sbprop.hxx b/basic/inc/sbprop.hxx
index fbeb138..2d44180 100644
--- a/basic/inc/sbprop.hxx
+++ b/basic/inc/sbprop.hxx
@@ -35,7 +35,7 @@ class BASIC_DLLPUBLIC SbProperty : public SbxProperty
 BASIC_DLLPRIVATE SbProperty( const OUString&, SbxDataType, SbModule* );
 virtual ~SbProperty();
 public:
-SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICPROP,1);
+SBX_DECL_PERSIST_NODATA(SBXID_BASICPROP,1);
 SbModule* GetModule() { return pMod; }
 };
 
diff --git a/basic/source/inc/sbjsmeth.hxx b/basic/source/inc/sbjsmeth.hxx
index ffd6c1e..c33f47d 100644
--- a/basic/source/inc/sbjsmeth.hxx
+++ b/basic/source/inc/sbjsmeth.hxx
@@ -33,7 +33,7 @@ public:
 SbJScriptMethod( const OUString&, SbxDataType, SbModule* );
 virtual ~SbJScriptMethod();
 
-SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_JSCRIPTMETH,2);
+SBX_DECL_PERSIST_NODATA(SBXID_JSCRIPTMETH,2);
 };
 
 
diff --git a/basic/source/inc/sbjsmod.hxx b/basic/source/inc/sbjsmod.hxx
index 9fa77e0..a29d570 100644
--- a/basic/source/inc/sbjsmod.hxx
+++ b/basic/source/inc/sbjsmod.hxx
@@ -31,7 +31,7 @@ class SbJScriptModule : public SbModule
 virtual bool LoadData( SvStream&, sal_uInt16 ) override;
 virtual bool StoreData( SvStream& ) const override;
 public:
-SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_JSCRIPTMOD,1);
+SBX_DECL_PERSIST_NODATA(SBXID_JSCRIPTMOD,1);
 SbJScriptModule( const OUString& );   // hand through
 };
 
diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx
index 7ff452d..c5e1162 100644
--- a/basic/source/sbx/sbxbase.cxx
+++ b/basic/source/sbx/sbxbase.cxx
@@ -243,7 +243,7 @@ bool SbxBase::Store( SvStream& rStrm )
 {
 if( ( nFlags & SbxFlagBits::DontStore ) == SbxFlagBits::NONE )
 {
-rStrm.WriteUInt32( GetCreator() )
+rStrm.WriteUInt32( SBXCR_SBX )
  .WriteUInt16( GetSbxId() )
  .WriteUInt16( static_cast(GetFlags()) )
  .WriteUInt16( GetVersion() );
diff --git a/include/basic/sbmeth.hxx b/include/basic/sbmeth.hxx
index 7919980..a49bcf2 100644
--- a/include/basic/sbmeth.hxx
+++ b/include/basic/sbmeth.hxx
@@ -51,7 +51,7 @@ class BASIC_DLLPUBLIC SbMethod : public SbxMethod
 virtual ~SbMethod();
 
 public:
-SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICMETHOD,2);
+SBX_DECL_PERSIST_NODATA(SBXID_BASICMETHOD,2);
 virtual SbxInfo* GetInfo() override;
 SbxArray*  GetStatics();
 void   ClearStatics();
diff --git a/include/basic/sbmod.hxx b/include/basic/sbmod.hxx
index 03d6fb2..ca6f57f 100644
--- a/include/basic/sbmod.hxx
+++ b/include/basic/sbmod.hxx
@@ -94,7 +94,7 @@ protected:
 void handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rHint 
);
 virtual ~SbModule();
 public:
-SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICMOD,2);
+SBX_DECL_PERSIST_NODATA(SBXID_BASICMOD,2);
 SbModule( const OUString&, bool bCompat = false );
 virtual voidSetParent( SbxObject* ) override;
 virtual voidClear() override;
diff --git a/include/basic/sbstar.hxx b/include/basic/sbstar.hxx
index 47f21bc..3ec0693 100644
--- a/include/basic/sbstar.hxx
+++ b/include/basic/sbstar.hxx
@@ -85,7 +85,7 @@ protected:
 
 public:
 
-SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASIC,1);
+SBX_DECL_PERSIST_NODATA(SBXID_BASIC,1);
 
 StarBASIC( StarBASIC* pParent = nullptr, bool bIsDocBasic = false );
 
diff --git a/include/basic/sbx.hxx b/include/basic/sbx.hxx
index 59b95aa..ac0f80b 100644
--- a/include/basic/sbx.hxx
+++ b/include/basic/sbx.hxx
@@ -133,7 +133,7 @@ protected:
 virtual bool StoreData( SvStream& ) const override;
 
 public:
-SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_ARRAY,1);
+SBX_DECL_PERSIST_NODATA(SBXID_ARRAY,1);
 SbxArray( SbxDataType=SbxVARIANT );
 SbxArray( const SbxArray& );
 SbxArray& operator=( const SbxArray& );
@@ -180,7 +180,7 @@ protected:
 virtual bool StoreData( SvStream& ) const override;
 virtual 

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

2016-08-13 Thread Arnaud Versini
 basic/inc/sbxbase.hxx|4 +++-
 basic/source/comp/symtbl.cxx |9 -
 basic/source/inc/runtime.hxx |4 ++--
 basic/source/inc/symtbl.hxx  |2 +-
 basic/source/runtime/methods.cxx |   14 ++
 basic/source/runtime/runtime.cxx |5 -
 basic/source/sbx/sbxbase.cxx |2 +-
 basic/source/sbx/sbxscan.cxx |8 +---
 8 files changed, 22 insertions(+), 26 deletions(-)

New commits:
commit cb3a00514a6baa9fe7c0660a743b95e1baed7bb8
Author: Arnaud Versini 
Date:   Sun Aug 7 12:24:28 2016 +0200

BASIC: Use more often std::unique_ptr

Change-Id: I37f3b35afcf3b4dba30a6ba841a59e0d851f1ebb
Reviewed-on: https://gerrit.libreoffice.org/27930
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/basic/inc/sbxbase.hxx b/basic/inc/sbxbase.hxx
index 39d0227..12ea126 100644
--- a/basic/inc/sbxbase.hxx
+++ b/basic/inc/sbxbase.hxx
@@ -37,7 +37,9 @@ struct SbxAppData
 SbxErroreSbxError;  // Error code
 std::vector
 m_Factories;
-SbxBasicFormater   *pBasicFormater;// Pointer to Format()-Command 
helper class
+
+// Pointer to Format()-Command helper class
+std::unique_ptr   pBasicFormater;
 
 LanguageTypeeBasicFormaterLangType;
 // It might be useful to store this class 'global' because some string 
resources are saved here
diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx
index 578d035..be8ac76 100644
--- a/basic/source/comp/symtbl.cxx
+++ b/basic/source/comp/symtbl.cxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 // All symbol names are laid down int the symbol-pool's stringpool, so that
 // all symbols are handled in the same case. On saving the code-image, the
@@ -281,15 +282,13 @@ SbiSymDef::SbiSymDef( const OUString& rName ) : aName( 
rName )
 bByVal   =
 bChained =
 bGlobal  = false;
-pIn  =
-pPool= nullptr;
+pIn  = nullptr;
 nDefaultId = 0;
 nFixedStringLength = -1;
 }
 
 SbiSymDef::~SbiSymDef()
 {
-delete pPool;
 }
 
 SbiProcDef* SbiSymDef::GetProcDef()
@@ -371,7 +370,7 @@ SbiSymPool& SbiSymDef::GetPool()
 {
 if( !pPool )
 {
-pPool = new SbiSymPool( pIn->pParser->aGblStrings, SbLOCAL, 
pIn->pParser );   // is dumped
+pPool = o3tl::make_unique( pIn->pParser->aGblStrings, 
SbLOCAL, pIn->pParser );// is dumped
 }
 return *pPool;
 }
@@ -397,7 +396,7 @@ SbiProcDef::SbiProcDef( SbiParser* pParser, const OUString& 
rName,
  , mbProcDecl( bProcDecl )
 {
 aParams.SetParent( >aPublics );
-pPool = new SbiSymPool( pParser->aGblStrings, SbLOCAL, pParser );
+pPool = o3tl::make_unique( pParser->aGblStrings, SbLOCAL, 
pParser );
 pPool->SetParent(  );
 nLine1  =
 nLine2  = 0;
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx
index 78b39a8..8278f76 100644
--- a/basic/source/inc/runtime.hxx
+++ b/basic/source/inc/runtime.hxx
@@ -107,12 +107,12 @@ class SbiRTLData
 {
 public:
 
-::osl::Directory* pDir;
+std::unique_ptr pDir;
 SbAttributes nDirFlags;
 short   nCurDirPos;
 
 OUString sFullNameToBeChecked;
-WildCard* pWildCard;
+std::unique_ptr pWildCard;
 
 css::uno::Sequence< OUString > aDirSeq;
 
diff --git a/basic/source/inc/symtbl.hxx b/basic/source/inc/symtbl.hxx
index e51a846..1fff808 100644
--- a/basic/source/inc/symtbl.hxx
+++ b/basic/source/inc/symtbl.hxx
@@ -88,7 +88,7 @@ protected:
 OUString aName;
 SbxDataType eType;
 SbiSymPool* pIn;// parent pool
-SbiSymPool* pPool;  // pool for sub-elements
+std::unique_ptr pPool; // pool for sub-elements
 short  nLen;// string length for STRING*n
 short  nDims;
 sal_uInt16 nId;
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 420298a..562c797 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -59,6 +59,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace comphelper;
 using namespace osl;
@@ -2720,8 +2721,7 @@ OUString implSetupWildcard( const OUString& rFileParam, 
SbiRTLData* pRTLData )
 static sal_Char cWild1 = '*';
 static sal_Char cWild2 = '?';
 
-delete pRTLData->pWildCard;
-pRTLData->pWildCard = nullptr;
+pRTLData->pWildCard.reset();
 pRTLData->sFullNameToBeChecked.clear();
 
 OUString aFileParam = rFileParam;
@@ -2775,7 +2775,7 @@ OUString implSetupWildcard( const OUString& rFileParam, 
SbiRTLData* pRTLData )
 // invalid anyway because it was not accepted by OSL before
 if (aPureFileName != "*")
 {
-pRTLData->pWildCard = new WildCard( aPureFileName );
+pRTLData->pWildCard = o3tl::make_unique( aPureFileName );
 }
 return aPathStr;
 }
@@ -3012,12 +3012,11 @@ RTLFUNC(Dir)
 

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

2016-07-18 Thread Arnaud Versini
 basic/inc/sbstdobj.hxx   |7 ++-
 basic/source/runtime/stdobj1.cxx |   19 ---
 2 files changed, 2 insertions(+), 24 deletions(-)

New commits:
commit ee2ad513de94ac395fd6be6f28c5202745ea7a2a
Author: Arnaud Versini 
Date:   Sat Jul 16 21:49:06 2016 +0200

BASIC: Remove useless overrides

Change-Id: I49eb680bb0945a65a98978e98750fd62669fd820
Reviewed-on: https://gerrit.libreoffice.org/27255
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/basic/inc/sbstdobj.hxx b/basic/inc/sbstdobj.hxx
index 2b3bf05..cd420ac 100644
--- a/basic/inc/sbstdobj.hxx
+++ b/basic/inc/sbstdobj.hxx
@@ -40,7 +40,7 @@ class BASIC_DLLPUBLIC SbStdPicture : public SbxObject
 protected:
 Graphic aGraphic;
 
-   virtual ~SbStdPicture();
+virtual ~SbStdPicture();
 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
 
 voidPropType( SbxVariable* pVar, SbxArray* pPar, bool bWrite );
@@ -50,7 +50,6 @@ protected:
 public:
 
 SbStdPicture();
-virtual SbxVariable* Find( const OUString&, SbxClassType ) override;
 
 const Graphic& GetGraphic() const { return aGraphic; }
 voidSetGraphic( const Graphic& rGrf ) { aGraphic = rGrf; }
@@ -67,7 +66,7 @@ protected:
 sal_uInt16  nSize;
 OUString  aName;
 
-   virtual ~SbStdFont();
+virtual ~SbStdFont();
 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
 
 voidPropBold( SbxVariable* pVar, SbxArray* pPar, bool bWrite );
@@ -80,7 +79,6 @@ protected:
 public:
 
 SbStdFont();
-virtual SbxVariable* Find( const OUString&, SbxClassType ) override;
 
 void SetBold( bool bB ) { bBold = bB; }
 bool IsBold() const { return bBold; }
@@ -114,7 +112,6 @@ protected:
 public:
 
 SbStdClipboard();
-virtual SbxVariable* Find( const OUString&, SbxClassType ) override;
 };
 
 #endif // INCLUDED_BASIC_INC_SBSTDOBJ_HXX
diff --git a/basic/source/runtime/stdobj1.cxx b/basic/source/runtime/stdobj1.cxx
index e06c99d..5c2e6e0 100644
--- a/basic/source/runtime/stdobj1.cxx
+++ b/basic/source/runtime/stdobj1.cxx
@@ -127,13 +127,6 @@ SbStdPicture::~SbStdPicture()
 }
 
 
-SbxVariable* SbStdPicture::Find( const OUString& rName, SbxClassType t )
-{
-// entered already?
-return SbxObject::Find( rName, t );
-}
-
-
 void SbStdPicture::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
 
 {
@@ -253,11 +246,6 @@ SbStdFont::~SbStdFont()
 {
 }
 
-SbxVariable* SbStdFont::Find( const OUString& rName, SbxClassType t )
-{
-return SbxObject::Find( rName, t );
-}
-
 void SbStdFont::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
 {
 const SbxHint* pHint = dynamic_cast();
@@ -413,13 +401,6 @@ SbStdClipboard::~SbStdClipboard()
 {
 }
 
-
-SbxVariable* SbStdClipboard::Find( const OUString& rName, SbxClassType t )
-{
-return SbxObject::Find( rName, t );
-}
-
-
 void SbStdClipboard::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
 {
 const SbxHint* pHint = dynamic_cast();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-03-08 Thread Steven Guo
 basic/inc/sbxbase.hxx   |5 ++---
 basic/source/classes/sbxmod.cxx |9 ++---
 basic/source/runtime/dllmgr-x64.cxx |   13 ++---
 basic/source/runtime/dllmgr-x86.cxx |   13 ++---
 4 files changed, 28 insertions(+), 12 deletions(-)

New commits:
commit 5819268ad709f52417b59421260e86e9c7e90f75
Author: Steven Guo 
Date:   Sun Mar 6 21:19:25 2016 -0800

tdf#94306 Replace boost::noncopyable with plain C++11 deleted copy ctors

Replaced boost::noncopyable with plain C++11 deleted copy ctors
in /basic/* files.

Change-Id: I9c0eb0a51ec5cb25c88c72b55f42864e73006e6b
Reviewed-on: https://gerrit.libreoffice.org/22969
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/basic/inc/sbxbase.hxx b/basic/inc/sbxbase.hxx
index ad10d61..39d0227 100644
--- a/basic/inc/sbxbase.hxx
+++ b/basic/inc/sbxbase.hxx
@@ -24,8 +24,6 @@
 #include 
 #include 
 
-#include 
-
 #include 
 #include 
 
@@ -35,7 +33,6 @@ class SbxBasicFormater;
 
 // AppData structure for SBX:
 struct SbxAppData
-: private ::boost::noncopyable
 {
 SbxErroreSbxError;  // Error code
 std::vector
@@ -46,6 +43,8 @@ struct SbxAppData
 // It might be useful to store this class 'global' because some string 
resources are saved here
 
 SbxAppData();
+SbxAppData(const SbxAppData&) = delete;
+const SbxAppData& operator=(const SbxAppData&) = delete;
 ~SbxAppData();
 };
 
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 033dd04..82aedf5 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -71,7 +71,6 @@
 #include 
 #include 
 #include 
-#include 
 #include "sbxmod.hxx"
 #include "parser.hxx"
 
@@ -446,11 +445,13 @@ bool getDefaultVBAMode( StarBASIC* pb )
 return xVBACompat.is() && xVBACompat->getVBACompatibilityMode();
 }
 
-class AsyncQuitHandler: private boost::noncopyable
+class AsyncQuitHandler
 {
 AsyncQuitHandler() {}
 
 public:
+AsyncQuitHandler(const AsyncQuitHandler&) = delete;
+const AsyncQuitHandler& operator=(const AsyncQuitHandler&) = delete;
 static AsyncQuitHandler& instance()
 {
 static AsyncQuitHandler dInst;
@@ -2242,7 +2243,7 @@ typedef ::cppu::WeakImplHelper<
 document::XDocumentEventListener > FormObjEventListener_BASE;
 
 class FormObjEventListenerImpl:
-public FormObjEventListener_BASE, private boost::noncopyable
+public FormObjEventListener_BASE
 {
 SbUserFormModule* mpUserForm;
 uno::Reference< lang::XComponent > mxComponent;
@@ -2253,6 +2254,8 @@ class FormObjEventListenerImpl:
 bool mbShowing;
 
 public:
+FormObjEventListenerImpl(const FormObjEventListenerImpl&) = delete;
+const FormObjEventListenerImpl& operator=(const FormObjEventListenerImpl&) 
= delete;
 FormObjEventListenerImpl( SbUserFormModule* pUserForm, const 
uno::Reference< lang::XComponent >& xComponent, const uno::Reference< 
frame::XModel >& xModel ) :
 mpUserForm( pUserForm ), mxComponent( xComponent), mxModel( xModel ),
 mbDisposed( false ), mbOpened( false ), mbActivated( false ), 
mbShowing( false )
diff --git a/basic/source/runtime/dllmgr-x64.cxx 
b/basic/source/runtime/dllmgr-x64.cxx
index 48e5cc7..11a514b 100644
--- a/basic/source/runtime/dllmgr-x64.cxx
+++ b/basic/source/runtime/dllmgr-x64.cxx
@@ -38,7 +38,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #undef max
 
@@ -102,8 +101,12 @@ struct StringData: public UnmarshalData {
 bool special;
 };
 
-class MarshalData: private boost::noncopyable {
+class MarshalData {
 public:
+MarshalData() = default;
+MarshalData(const MarshalData&) = delete;
+const MarshalData& operator=(const MarshalData&) = delete;
+
 std::vector< char > * newBlob() {
 blobs_.push_front(std::vector< char >());
 return _.front();
@@ -714,11 +717,15 @@ OUString fullDllName(OUString const & name) {
 
 }
 
-struct SbiDllMgr::Impl: private boost::noncopyable {
+struct SbiDllMgr::Impl{
 private:
 typedef std::map< OUString, ::rtl::Reference< Dll > > Dlls;
 
 public:
+Impl() = default;
+Impl(const Impl&) = delete;
+const Impl& operator=(const Impl&) = delete;
+
 Dll * getDll(OUString const & name);
 
 Dlls dlls;
diff --git a/basic/source/runtime/dllmgr-x86.cxx 
b/basic/source/runtime/dllmgr-x86.cxx
index 2bb2993..bd8c5be 100644
--- a/basic/source/runtime/dllmgr-x86.cxx
+++ b/basic/source/runtime/dllmgr-x86.cxx
@@ -38,7 +38,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #undef max
 
@@ -110,8 +109,12 @@ struct StringData: public UnmarshalData {
 bool special;
 };
 
-class MarshalData: private boost::noncopyable {
+class MarshalData {
 public:
+MarshalData() = default;
+MarshalData(const MarshalData&) = delete;
+const MarshalData& operator=(const MarshalData&) = delete;
+
 std::vector< char > * newBlob() {

[Libreoffice-commits] core.git: basic/inc basic/source bean/com bean/Module_bean.mk bin/fuzzfiles bridges/test canvas/source canvas/workben

2016-01-04 Thread Andrea Gelmini
 basic/inc/sbxbase.hxx |2 +-
 basic/source/classes/sb.cxx   |2 +-
 basic/source/classes/sbxmod.cxx   |4 ++--
 basic/source/comp/loops.cxx   |2 +-
 basic/source/runtime/methods1.cxx |2 +-
 basic/source/runtime/runtime.cxx  |2 +-
 basic/source/uno/scriptcont.cxx   |2 +-
 bean/Module_bean.mk   |2 +-
 bean/com/sun/star/comp/beans/OOoBean.java |2 +-
 bin/fuzzfiles |2 +-
 bridges/test/testsameprocess.cxx  |2 +-
 canvas/source/directx/dx_9rm.cxx  |2 +-
 canvas/source/tools/surfaceproxy.hxx  |2 +-
 canvas/source/vcl/canvashelper.cxx|2 +-
 canvas/workben/canvasdemo.cxx |4 ++--
 15 files changed, 17 insertions(+), 17 deletions(-)

New commits:
commit 92e60e1b80a391864314c2270d2d9fcd9da3d9ee
Author: Andrea Gelmini 
Date:   Mon Jan 4 12:37:59 2016 +0100

Fix typos

Change-Id: I1b79005d9c4e32325b8dadcc4f805975d6bf2727
Reviewed-on: https://gerrit.libreoffice.org/21103
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/basic/inc/sbxbase.hxx b/basic/inc/sbxbase.hxx
index 3128361..ad10d61 100644
--- a/basic/inc/sbxbase.hxx
+++ b/basic/inc/sbxbase.hxx
@@ -43,7 +43,7 @@ struct SbxAppData
 SbxBasicFormater   *pBasicFormater;// Pointer to Format()-Command 
helper class
 
 LanguageTypeeBasicFormaterLangType;
-// It might be useful to store this class 'global' because some string 
reosurces are saved here
+// It might be useful to store this class 'global' because some string 
resources are saved here
 
 SbxAppData();
 ~SbxAppData();
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 60d2b02..41e9ab0 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1636,7 +1636,7 @@ void StarBASIC::MakeErrorText( SbError nId, const 
OUString& aMsg )
 SolarMutexGuard aSolarGuard;
 sal_uInt16 nOldID = GetVBErrorCode( nId );
 
-// intantiate the help class
+// instantiate the help class
 BasResId aId( RID_BASIC_START );
 BasicStringList_Impl aMyStringList( aId, sal_uInt16(nId & 
ERRCODE_RES_MASK) );
 
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 55d9a65..2834dd2 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1420,7 +1420,7 @@ void SbModule::GlobalRunInit( bool bBasicStart )
 
 // Initialise GlobalInitErr-Flag for Compiler-Error
 // With the help of this flags could be located in SbModule::Run() after 
the call of
-// GlobalRunInit, if at the intialising of the module
+// GlobalRunInit, if at the initialising of the module
 // an error occurred. Then it will not be launched.
 GetSbData()->bGlobalInitErr = false;
 
@@ -2428,7 +2428,7 @@ public:
 
 virtual void SAL_CALL documentEventOccured( const document::DocumentEvent& 
rEvent ) throw (uno::RuntimeException, std::exception) override
 {
-// early dosposing on document event "OnUnload", to be sure Basic 
still exists when calling VBA "UserForm_Terminate"
+// early disposing on document event "OnUnload", to be sure Basic 
still exists when calling VBA "UserForm_Terminate"
 if( rEvent.EventName == GlobalEventConfig::GetEventName( 
GlobalEventId::CLOSEDOC ) )
 {
 removeListener();
diff --git a/basic/source/comp/loops.cxx b/basic/source/comp/loops.cxx
index fb9680d..92a4fcb 100644
--- a/basic/source/comp/loops.cxx
+++ b/basic/source/comp/loops.cxx
@@ -209,7 +209,7 @@ void SbiParser::For()
 {
 TestToken( _IN_ );
 SbiExpression aCollExpr( this, SbOPERAND );
-aCollExpr.Gen();// Colletion var to for stack
+aCollExpr.Gen();// Collection var to for stack
 TestEoln();
 aGen.Gen( _INITFOREACH );
 }
diff --git a/basic/source/runtime/methods1.cxx 
b/basic/source/runtime/methods1.cxx
index 1f38637..2acff35 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -896,7 +896,7 @@ RTLFUNC(DimArray)
 /*
  * FindObject and FindPropertyObject make it possible to
  * address objects and properties of the type Object with
- * their name as string-pararmeters at the runtime.
+ * their name as string-parameters at the runtime.
  *
  * Example:
  * MyObj.Prop1.Bla = 5
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index e1fd768..36e82c1 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -1866,7 +1866,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, 
SbxVariableRef& refVar, b
 // SbxVariable* defaultProp = NULL; unused variable
 // LHS try determine if a default prop exists
 // again like in StepPUT (see 

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

2015-05-19 Thread Michael Stahl
 basic/inc/pch/precompiled_sb.hxx |2 -
 basic/source/runtime/methods.cxx |   46 +--
 2 files changed, 40 insertions(+), 8 deletions(-)

New commits:
commit 564fc483931c0aa2872a33023473c7ac36bfedf1
Author: Michael Stahl mst...@redhat.com
Date:   Tue May 19 21:48:55 2015 +0200

tdf#90110: basic: fix Randomize statement

- time() is used to seed the RNG but since it only has second resolution,
  the same values will be generated if it's called multiple times like
  in the bug report

- BASIC using the global rng would be fine except that BASIC Randomize
  takes an optional parameter to set the seed, which should continue
  to be supported, but should not affect the RNG state for non-BASIC
  users of comphelper::random

(regression from df466d79cb126667cc9d5c108367bfa4f5ce76c8,
 but the old implementation was even more delightfully absurd,
 where Randomize was essentially srand((sal_uInt16)rand()) ...)

Change-Id: I0f30e509de08f933c02ac77c5d932b20e79586c5

diff --git a/basic/inc/pch/precompiled_sb.hxx b/basic/inc/pch/precompiled_sb.hxx
index 8ed406d..d797b0b 100644
--- a/basic/inc/pch/precompiled_sb.hxx
+++ b/basic/inc/pch/precompiled_sb.hxx
@@ -30,7 +30,6 @@
 #include com/sun/star/uno/XInterface.hpp
 #include com/sun/star/util/DateTime.hpp
 #include comphelper/processfactory.hxx
-#include comphelper/random.hxx
 #include comphelper/string.hxx
 #include config_features.h
 #include config_version.h
@@ -46,6 +45,7 @@
 #include osl/file.hxx
 #include osl/process.h
 #include osl/time.h
+#include random
 #include rtl/character.hxx
 #include rtl/instance.hxx
 #include rtl/math.hxx
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 377b66c..a2bb346 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -47,7 +47,6 @@
 #include errobject.hxx
 
 #include comphelper/processfactory.hxx
-#include comphelper/random.hxx
 #include comphelper/string.hxx
 
 #include com/sun/star/uno/Sequence.hxx
@@ -61,6 +60,8 @@
 #include boost/scoped_array.hpp
 #include boost/scoped_ptr.hpp
 
+#include random
+
 using namespace comphelper;
 using namespace osl;
 using namespace com::sun::star;
@@ -3518,6 +3519,38 @@ RTLFUNC(Format)
 }
 }
 
+namespace {
+
+// note: BASIC does not use comphelper::random, because
+// Randomize(int) must be supported and should not affect non-BASIC random use
+struct RandomNumberGenerator
+{
+std::mt19937 global_rng;
+
+RandomNumberGenerator()
+{
+try
+{
+std::random_device rd;
+// initialises the state of the global random number generator
+// should only be called once.
+// (note, a few std::variate_generator (like normal) have their
+// own state which would need a reset as well to guarantee 
identical
+// sequence of numbers, e.g. via myrand.distribution().reset())
+global_rng.seed(rd() ^ time(nullptr));
+}
+catch (std::runtime_error e)
+{
+SAL_WARN(basic, Using std::random_device failed:   e.what());
+global_rng.seed(time(nullptr));
+}
+}
+};
+
+class theRandomNumberGenerator : public rtl::StaticRandomNumberGenerator, 
theRandomNumberGenerator {};
+
+}
+
 RTLFUNC(Randomize)
 {
 (void)pBasic;
@@ -3531,12 +3564,9 @@ RTLFUNC(Randomize)
 if( rPar.Count() == 2 )
 {
 nSeed = (int)rPar.Get(1)-GetInteger();
+theRandomNumberGenerator::get().global_rng.seed(nSeed);
 }
-else
-{
-nSeed = (int)time(NULL);
-}
-comphelper::rng::reseed(nSeed);
+// without parameter, no need to do anything - RNG is seeded at first use
 }
 
 RTLFUNC(Rnd)
@@ -3550,7 +3580,9 @@ RTLFUNC(Rnd)
 }
 else
 {
-rPar.Get(0)-PutDouble(comphelper::rng::uniform_real_distribution());
+std::uniform_real_distributiondouble dist(0.0, 1.0);
+double const tmp(dist(theRandomNumberGenerator::get().global_rng));
+rPar.Get(0)-PutDouble(tmp);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-17 Thread Thomas Arnhold
 basic/inc/pch/precompiled_sb.hxx |1 +
 basic/source/runtime/methods.cxx |   13 ++---
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit df466d79cb126667cc9d5c108367bfa4f5ce76c8
Author: Thomas Arnhold tho...@arnhold.org
Date:   Tue May 13 22:42:49 2014 +0200

fdo#70474: Random number generation weak with Rnd in BASIC

Just reuse the rng functionality. This improves the randomness.

Initialize seed with system time if no argument for RANDOMIZE is given. As 
the help text
states: If Number is omitted, the generator uses the current value of the 
system timer.

Change-Id: I5fa46e8344b2402dff66a8db2449d43e2ca27d6d
Reviewed-on: https://gerrit.libreoffice.org/9349
Reviewed-by: Thomas Arnhold tho...@arnhold.org
Tested-by: Thomas Arnhold tho...@arnhold.org

diff --git a/basic/inc/pch/precompiled_sb.hxx b/basic/inc/pch/precompiled_sb.hxx
index 4c0ba1b..a7cd16b 100644
--- a/basic/inc/pch/precompiled_sb.hxx
+++ b/basic/inc/pch/precompiled_sb.hxx
@@ -29,6 +29,7 @@
 #include com/sun/star/uno/XInterface.hpp
 #include com/sun/star/util/DateTime.hpp
 #include comphelper/processfactory.hxx
+#include comphelper/random.hxx
 #include comphelper/string.hxx
 #include cstddef
 #include ctype.h
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index fe2f00d..2e3c375 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -45,6 +45,7 @@
 #include errobject.hxx
 
 #include comphelper/processfactory.hxx
+#include comphelper/random.hxx
 #include comphelper/string.hxx
 
 #include com/sun/star/uno/Sequence.hxx
@@ -3521,16 +3522,16 @@ RTLFUNC(Randomize)
 {
 StarBASIC::Error( SbERR_BAD_ARGUMENT );
 }
-sal_Int16 nSeed;
+int nSeed;
 if( rPar.Count() == 2 )
 {
-nSeed = (sal_Int16)rPar.Get(1)-GetInteger();
+nSeed = (int)rPar.Get(1)-GetInteger();
 }
 else
 {
-nSeed = (sal_Int16)rand();
+nSeed = (int)time(NULL);
 }
-srand( nSeed );
+comphelper::rng::seed( nSeed );
 }
 
 RTLFUNC(Rnd)
@@ -3544,9 +3545,7 @@ RTLFUNC(Rnd)
 }
 else
 {
-double nRand = (double)rand();
-nRand = ( nRand / ((double)RAND_MAX + 1.0));
-rPar.Get(0)-PutDouble( nRand );
+rPar.Get(0)-PutDouble( comphelper::rng::uniform() );
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-09 Thread Stephan Bergmann
 basic/inc/sb.hxx  |3 
 basic/source/basmgr/basmgr.cxx|2 
 basic/source/classes/eventatt.cxx |2 
 basic/source/classes/propacc.cxx  |   10 -
 basic/source/classes/sb.cxx   |2 
 basic/source/classes/sbunoobj.cxx |4 
 basic/source/classes/sbxmod.cxx   |   11 -
 basic/source/inc/eventatt.hxx |   35 +++
 basic/source/inc/rtlproto.hxx |  375 ++
 basic/source/inc/runtime.hxx  |2 
 basic/source/inc/sbunoobj.hxx |7 
 basic/source/runtime/methods1.cxx |7 
 basic/source/runtime/rtlproto.hxx |  375 --
 basic/source/runtime/runtime.cxx  |5 
 basic/source/sbx/sbxvalue.cxx |4 
 basic/source/sbx/sbxvar.cxx   |6 
 basic/source/uno/dlgcont.cxx  |1 
 basic/source/uno/sbservices.cxx   |8 
 basic/source/uno/sbservices.hxx   |   35 +++
 basic/source/uno/scriptcont.cxx   |1 
 20 files changed, 473 insertions(+), 422 deletions(-)

New commits:
commit cc725643fded8c9237403f12bb6eed9d964e55c9
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Apr 9 10:11:46 2014 +0200

Clean up function declarations and some unused functions

Change-Id: I63c4c61847fea4500b667a5ea9f2b32207692033

diff --git a/basic/inc/sb.hxx b/basic/inc/sb.hxx
index 6a3c2f7..cd028f7 100644
--- a/basic/inc/sb.hxx
+++ b/basic/inc/sb.hxx
@@ -28,6 +28,9 @@
 
 #include sbprop.hxx
 
+// create object from user-type  (+StringID+StringID)
+SbxObject* createUserTypeImpl( const OUString rClassName );
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index b8cc7cf..09486cf 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -393,7 +393,6 @@ private:
 public:
 BasicLibInfo();
 
-bool  IsReference() const { return bReference; }
 bool IsReference()   { return bReference; }
 
 bool  IsExtern() const{ return ! 
aStorageName.equalsAscii(szImbedded); }
@@ -424,7 +423,6 @@ public:
 const OUString   GetPassword() const { return aPassword; }
 void  SetPassword( const OUString rNewPassword )
 { aPassword = 
rNewPassword; }
-bool  IsPasswordVerified() const  { return 
bPasswordVerified; }
 void  SetPasswordVerified()   { bPasswordVerified 
= true; }
 
 static BasicLibInfo*Create( SotStorageStream rSStream );
diff --git a/basic/source/classes/eventatt.cxx 
b/basic/source/classes/eventatt.cxx
index ff1d60c..16fc4bd 100644
--- a/basic/source/classes/eventatt.cxx
+++ b/basic/source/classes/eventatt.cxx
@@ -56,7 +56,7 @@
 #include basic/sbuno.hxx
 #include runtime.hxx
 #include sbintern.hxx
-
+#include eventatt.hxx
 
 #include cppuhelper/implbase1.hxx
 using namespace ::com::sun::star;
diff --git a/basic/source/classes/propacc.cxx b/basic/source/classes/propacc.cxx
index 41781f7..913237c 100644
--- a/basic/source/classes/propacc.cxx
+++ b/basic/source/classes/propacc.cxx
@@ -34,20 +34,10 @@ using namespace cppu;
 
 struct SbCompare_UString_PropertyValue_Impl
 {
-   bool operator() (const OUString lhs, PropertyValue const  rhs)
-   {
-  return lhs.compareTo(rhs.Name)  0;
-   }
bool operator() (PropertyValue const  lhs, const OUString rhs)
{
   return lhs.Name.compareTo(rhs)  0;
}
-#ifdef DBG_UTIL
-   bool operator() (PropertyValue const  lhs, const PropertyValue rhs)
-   {
-   return lhs.Name.compareTo(rhs.Name)  0;
-   }
-#endif
 };
 
 extern C int SAL_CALL SbCompare_UString_Property_Impl( const void *arg1, 
const void *arg2 )
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 526a013..0acfc92 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -459,8 +459,6 @@ SbxBase* SbOLEFactory::Create( sal_uInt16, sal_uInt32 )
 return NULL;
 }
 
-SbUnoObject* createOLEObject_Impl( const OUString aType );  // sbunoobj.cxx
-
 SbxObject* SbOLEFactory::CreateObject( const OUString rClassName )
 {
 SbxObject* pRet = createOLEObject_Impl( rClassName );
diff --git a/basic/source/classes/sbunoobj.cxx 
b/basic/source/classes/sbunoobj.cxx
index 9a0d83c..74f5fec 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -70,6 +70,8 @@
 #include com/sun/star/script/XAutomationInvocation.hpp
 #include basic/codecompletecache.hxx
 
+#include rtlproto.hxx
+
 using com::sun::star::uno::Reference;
 using namespace com::sun::star::uno;
 using namespace com::sun::star::lang;
@@ -468,8 +470,6 @@ struct ObjectItem
 {
 SbxObjectRefm_xNativeObj;
 
-ObjectItem( void )
-{}
 ObjectItem( SbxObject* pNativeObj )
 : m_xNativeObj( pNativeObj )
 {}
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 616b1a1..668c252