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

2021-09-19 Thread Andreas Heinisch (via logerrit)
 basic/inc/strings.hrc   |1 +
 basic/qa/cppunit/test_vba.cxx   |1 +
 basic/qa/vba_tests/error_message.vb |   34 ++
 basic/source/classes/sb.cxx |   14 ++
 basic/source/runtime/runtime.cxx|   12 +++-
 5 files changed, 53 insertions(+), 9 deletions(-)

New commits:
commit adb38e36e3944b47dbf278f882dd07cbabea5ced
Author: Andreas Heinisch 
AuthorDate: Thu Sep 16 18:43:50 2021 +0200
Commit: Andreas Heinisch 
CommitDate: Sun Sep 19 18:46:35 2021 +0200

tdf#123144 - Always translate an error number to a vba error message

In addition, create a meaningful error message and don't create and
artificial error message if there exists a custom one.

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

diff --git a/basic/inc/strings.hrc b/basic/inc/strings.hrc
index 7aeb2831a64a..64b65db342cc 100644
--- a/basic/inc/strings.hrc
+++ b/basic/inc/strings.hrc
@@ -31,5 +31,6 @@
 #define STR_BASICKEY_FORMAT_CURRENCYNC_("STR_BASICKEY_FORMAT_CURRENCY", 
"@0.00 $;@(0.00 $)")
 
 #define IDS_SBERR_TERMINATEDNC_("IDS_SBERR_TERMINATED", "The macro 
running has been interrupted")
+#define STR_ADDITIONAL_INFO NC_("STR_ADDITIONAL_INFO", 
"$ERR\nAdditional information: $MSG")
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/qa/cppunit/test_vba.cxx b/basic/qa/cppunit/test_vba.cxx
index 64875b9e1c46..036d3b52cfe4 100644
--- a/basic/qa/cppunit/test_vba.cxx
+++ b/basic/qa/cppunit/test_vba.cxx
@@ -85,6 +85,7 @@ void VBATest::testMiscVBAFunctions()
 "day.vb",
 "enum.vb",
 "error.vb",
+"error_message.vb",
 "Err.Raise.vb",
 "exp.vb",
 "fix.vb",
diff --git a/basic/qa/vba_tests/error_message.vb 
b/basic/qa/vba_tests/error_message.vb
new file mode 100644
index ..7f960573596a
--- /dev/null
+++ b/basic/qa/vba_tests/error_message.vb
@@ -0,0 +1,34 @@
+'
+' This file is part of the LibreOffice project.
+'
+' This Source Code Form is subject to the terms of the Mozilla Public
+' License, v. 2.0. If a copy of the MPL was not distributed with this
+' file, You can obtain one at http://mozilla.org/MPL/2.0/.
+'
+
+Option VBASupport 1
+Option Explicit
+
+Function doUnitTest() As String
+TestUtil.TestInit
+verify_testErrorMessage
+doUnitTest = TestUtil.GetResult()
+End Function
+
+Sub verify_testErrorMessage()
+
+try: On Error Goto catch
+
+a = 5
+
+catch:
+
+' tdf#123144 - check for a meaningful error message
+' Without the fix in place, this test would have failed with
+' - Expected: Variable not defined.\n Additional information: a
+' - Actual  : a
+TestUtil.AssertEqual(Err.Description, _
++ "Variable not defined." & Chr$(10) & "Additional information: a", _
++ "Err.Description failure (Err.Description = " & Err.Description & 
")")
+
+End Sub
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 8f2155e6d218..955aabe57c15 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -53,6 +53,8 @@
 #include 
 #include 
 
+#include 
+
 using namespace ::com::sun::star::script;
 
 constexpr OUStringLiteral SB_RTLNAME = u"@SBRTL";
@@ -1570,8 +1572,20 @@ void StarBASIC::MakeErrorText( ErrCode nId, 
std::u16string_view aMsg )
 aMsg1.remove(nResult, aSrgStr.getLength());
 aMsg1.insert(nResult, aMsg);
 }
+else if (!aMsg.empty())
+{
+// tdf#123144 - create a meaningful error message
+aMsg1 = BasResId(STR_ADDITIONAL_INFO)
+.replaceFirst("$ERR", aMsg1)
+.replaceFirst("$MSG", aMsg);
+}
 GetSbData()->aErrMsg = aMsg1.makeStringAndClear();
 }
+// tdf#123144 - don't use an artifical error message if there is a custom 
one
+else if (!aMsg.empty())
+{
+GetSbData()->aErrMsg = aMsg;
+}
 else if( nOldID != 0 )
 {
 OUString aStdMsg = "Error " + OUString::number(nOldID) +
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index cbe62a6a4112..9a2a79e349b5 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -992,15 +992,9 @@ sal_Int32 SbiRuntime::translateErrorToVba( ErrCode nError, 
OUString& rMsg )
 // if there is an error defined it more than likely
 // is not the one you want ( some are the same though )
 // we really need a new vba compatible error list
-if ( rMsg.isEmpty() )
-{
-StarBASIC::MakeErrorText( nError, rMsg );
-rMsg = StarBASIC::GetErrorText();
-if ( rMsg.isEmpty() ) // no message for err no, need localized 
resource here
-{
-rMsg = "Internal Object Error:";
-}
-}
+// tdf#123144 - always translate 

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

2020-11-13 Thread Philipp Hofer (via logerrit)
 basic/inc/global.hxx|5 -
 basic/inc/sb.hxx|4 
 basic/inc/sbxbase.hxx   |   10 +-
 basic/inc/sbxfac.hxx|6 -
 basic/qa/cppunit/basictest.hxx  |   10 +-
 basic/qa/cppunit/test_scanner.cxx   |  143 
 basic/source/inc/errobject.hxx  |   11 +-
 basic/source/inc/sbjsmeth.hxx   |6 -
 basic/source/inc/sbjsmod.hxx|   10 +-
 basic/source/inc/stdobj.hxx |   11 +-
 basic/source/runtime/comenumwrapper.hxx |   10 +-
 basic/source/uno/modsizeexceeded.cxx|   19 ++--
 solenv/clang-format/excludelist |   12 --
 13 files changed, 123 insertions(+), 134 deletions(-)

New commits:
commit 16389aae367ebfa8ce19f8ee1c26232fec7ff729
Author: Philipp Hofer 
AuthorDate: Thu Nov 12 12:48:50 2020 +0100
Commit: Christian Lohmaier 
CommitDate: Fri Nov 13 14:31:50 2020 +0100

tdf#123936 Formatting files in module basic with clang-format

Change-Id: I87736d6f1a1d069c990b4e7b9ca291634ab4fb44
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105646
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier 

diff --git a/basic/inc/global.hxx b/basic/inc/global.hxx
index aa101a562ced..0f380cad3fdd 100644
--- a/basic/inc/global.hxx
+++ b/basic/inc/global.hxx
@@ -9,8 +9,9 @@
 
 #pragma once
 
-namespace utl {
-class TransliterationWrapper;
+namespace utl
+{
+class TransliterationWrapper;
 }
 
 class SbGlobal
diff --git a/basic/inc/sb.hxx b/basic/inc/sb.hxx
index 4f3132fcf569..f94c52a6e045 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 );
+SbxObject* createUserTypeImpl(const OUString& rClassName);
 
-SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj );
+SbxObject* cloneTypeObjectImpl(const SbxObject& rTypeObj);
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/inc/sbxbase.hxx b/basic/inc/sbxbase.hxx
index 40255c485a8f..80552c2fbf08 100644
--- a/basic/inc/sbxbase.hxx
+++ b/basic/inc/sbxbase.hxx
@@ -35,15 +35,15 @@ class SbxBasicFormater;
 // AppData structure for SBX:
 struct SbxAppData
 {
-ErrCode eErrCode;  // Error code
-SbxVariableRef  m_aGlobErr; // Global error object
+ErrCode eErrCode; // Error code
+SbxVariableRef m_aGlobErr; // Global error object
 std::vector m_Factories; // these are owned by fields in 
SbiGlobals
-tools::SvRef  mrImplRepository;
+tools::SvRef mrImplRepository;
 
 // Pointer to Format()-Command helper class
-std::unique_ptr   pBasicFormater;
+std::unique_ptr pBasicFormater;
 
-LanguageTypeeBasicFormaterLangType;
+LanguageType eBasicFormaterLangType;
 // It might be useful to store this class 'global' because some string 
resources are saved here
 
 SbxAppData();
diff --git a/basic/inc/sbxfac.hxx b/basic/inc/sbxfac.hxx
index 7e92f895adaf..28257b17a6d7 100644
--- a/basic/inc/sbxfac.hxx
+++ b/basic/inc/sbxfac.hxx
@@ -28,9 +28,9 @@ class SbxFactory
 {
 public:
 virtual ~SbxFactory();
-SbxFactory()  {}
-virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 );
-virtual SbxObject* CreateObject( const OUString& );
+SbxFactory() {}
+virtual SbxBase* Create(sal_uInt16 nSbxId, sal_uInt32);
+virtual SbxObject* CreateObject(const OUString&);
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/qa/cppunit/basictest.hxx b/basic/qa/cppunit/basictest.hxx
index f5fb79f557ba..c0afeb5bd18c 100644
--- a/basic/qa/cppunit/basictest.hxx
+++ b/basic/qa/cppunit/basictest.hxx
@@ -29,21 +29,21 @@ private:
 StarBASICRef mpBasic;
 
 void InitSnippet();
-void MakeModule( const OUString& sSource );
+void MakeModule(const OUString& sSource);
 
 public:
-explicit MacroSnippet( const OUString& sSource );
+explicit MacroSnippet(const OUString& sSource);
 MacroSnippet();
 
-void LoadSourceFromFile( const OUString& sMacroFileURL );
+void LoadSourceFromFile(const OUString& sMacroFileURL);
 
-SbxVariableRef Run( const css::uno::Sequence< css::uno::Any >& rArgs );
+SbxVariableRef Run(const css::uno::Sequence& rArgs);
 
 SbxVariableRef Run();
 
 bool Compile();
 
-DECL_LINK( BasicErrorHdl, StarBASIC *, bool );
+DECL_LINK(BasicErrorHdl, StarBASIC*, bool);
 
 bool HasError() const;
 const ErrCode& getError() const;
diff --git a/basic/qa/cppunit/test_scanner.cxx 
b/basic/qa/cppunit/test_scanner.cxx
index 7515b0d07862..ed340755deba 100644
--- a/basic/qa/cppunit/test_scanner.cxx
+++ b/basic/qa/cppunit/test_scanner.cxx
@@ -19,22 +19,22 @@
 
 namespace
 {
-  struct Symbol
-  {
+struct Symbol
+{
 sal_uInt16 line;
 sal_uInt16 col1;
 OUString text;
 double number;
 SbxDataType type;
 bool ws;
-  };
+};
 
-  /**
+/**
* Perform tests on Scanner.
   

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

2020-09-04 Thread George Bateman (via logerrit)
 basic/inc/basic.hrc |5 +
 basic/inc/global.hxx|5 +
 basic/inc/sb.hxx|5 +
 basic/inc/sbobjmod.hxx  |5 +
 basic/inc/sbprop.hxx|5 +
 basic/inc/sbstdobj.hxx  |5 +
 basic/inc/sbxbase.hxx   |5 +
 basic/inc/strings.hrc   |5 +
 basic/qa/cppunit/basictest.hxx  |5 +
 basic/source/inc/basiccharclass.hxx |5 +
 basic/source/inc/buffer.hxx |5 +
 basic/source/inc/codegen.hxx|5 +
 basic/source/inc/date.hxx   |5 +
 basic/source/inc/dlgcont.hxx|5 +
 basic/source/inc/errobject.hxx  |4 +---
 basic/source/inc/eventatt.hxx   |5 +
 basic/source/inc/expr.hxx   |5 +
 basic/source/inc/filefmt.hxx|5 +
 basic/source/inc/image.hxx  |5 +
 basic/source/inc/iosys.hxx  |5 +
 basic/source/inc/namecont.hxx   |5 +
 basic/source/inc/opcodes.hxx|5 +
 basic/source/inc/parser.hxx |5 +
 basic/source/inc/propacc.hxx|5 +
 basic/source/inc/rtlproto.hxx   |5 +
 basic/source/inc/runtime.hxx|5 +
 basic/source/inc/sbintern.hxx   |5 +
 basic/source/inc/sbjsmeth.hxx   |5 +
 basic/source/inc/sbjsmod.hxx|5 +
 basic/source/inc/sbunoobj.hxx   |5 +
 basic/source/inc/sbxmod.hxx |5 +
 basic/source/inc/scanner.hxx|5 +
 basic/source/inc/scriptcont.hxx |5 +
 basic/source/inc/stdobj.hxx |5 +
 basic/source/inc/symtbl.hxx |5 +
 basic/source/inc/token.hxx  |5 +
 basic/source/runtime/dllmgr.hxx |5 +
 basic/source/sbx/sbxconv.hxx|5 +
 38 files changed, 38 insertions(+), 151 deletions(-)

New commits:
commit fb4ddf2fc997f3b0c193b6dce22a0b1313f24240
Author: George Bateman 
AuthorDate: Tue Aug 4 21:07:00 2020 +
Commit: Julien Nabet 
CommitDate: Fri Sep 4 08:57:06 2020 +0200

tdf#124176 Use #pragma once in basic

This commit was carried out by a Python script, source of which
is at https://bugs.documentfoundation.org/show_bug.cgi?id=124176#c97.

Change-Id: Ief7f29d8efaa3d6ac417080f3147a087844621a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100128
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/basic/inc/basic.hrc b/basic/inc/basic.hrc
index c860fce7aaed..1a063615318e 100644
--- a/basic/inc/basic.hrc
+++ b/basic/inc/basic.hrc
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASIC_INC_STRINGS_HRC
-#define INCLUDED_BASIC_INC_STRINGS_HRC
+#pragma once
 
 #define NC_(Context, String) reinterpret_cast(Context "\004" 
u8##String)
 
@@ -156,6 +155,4 @@ std::pair const RID_BASIC_START[] =
 { nullptr, ERRCODE_NONE }
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/inc/global.hxx b/basic/inc/global.hxx
index 640759ef8c17..aa101a562ced 100644
--- a/basic/inc/global.hxx
+++ b/basic/inc/global.hxx
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_BASIC_INC_GLOBAL_HXX
-#define INCLUDED_BASIC_INC_GLOBAL_HXX
+#pragma once
 
 namespace utl {
 class TransliterationWrapper;
@@ -20,6 +19,4 @@ public:
 static utl::TransliterationWrapper& GetTransliteration();
 };
 
-#endif // INCLUDED_BASIC_INC_GLOBAL_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/inc/sb.hxx b/basic/inc/sb.hxx
index bfac343fb5d6..4f3132fcf569 100644
--- a/basic/inc/sb.hxx
+++ b/basic/inc/sb.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASIC_INC_SB_HXX
-#define INCLUDED_BASIC_INC_SB_HXX
+#pragma once
 
 #include 
 
@@ -27,6 +26,4 @@ SbxObject* createUserTypeImpl( const OUString& rClassName );
 
 SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj );
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/inc/sbobjmod.hxx b/basic/inc/sbobjmod.hxx
index b87892f52323..788be5fe43dd 100644
--- a/basic/inc/sbobjmod.hxx
+++ b/basic/inc/sbobjmod.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASIC_INC_SBOBJMOD_HXX
-#define INCLUDED_BASIC_INC_SBOBJMOD_HXX
+#pragma once
 
 #include 
 #include 
@@ -94,6 +93,4 @@ public:
 virtual SbxVariable* Find( const OUString& rName, SbxClassType t ) 
override;
 };
 
-#endif // INCLUDED_BASIC_INC_SBOBJMOD_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/inc/sbprop.hxx b/basic/inc/sbprop.hxx
index bd4a8b117c54..e554267f9e0b 100644
--- a/basic/inc/sbprop.hxx
+++ b/basic/inc/sbprop.hxx
@@ -17,8 +17,7 @@
  *   the License at 

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

2019-09-03 Thread Noel Grandin (via logerrit)
 basic/inc/sbobjmod.hxx|2 -
 basic/inc/sbprop.hxx  |2 -
 basic/qa/cppunit/basictest.cxx|2 -
 basic/qa/cppunit/basictest.hxx|2 -
 basic/source/basmgr/basmgr.cxx|2 -
 basic/source/classes/sbunoobj.cxx |2 -
 basic/source/classes/sbxmod.cxx   |2 -
 basic/source/comp/codegen.cxx |2 -
 basic/source/comp/exprnode.cxx|6 ++--
 basic/source/comp/exprtree.cxx|2 -
 basic/source/inc/buffer.hxx   |2 -
 basic/source/inc/codegen.hxx  |4 +--
 basic/source/inc/dlgcont.hxx  |4 +--
 basic/source/inc/expr.hxx |   48 +++---
 basic/source/inc/image.hxx|4 +--
 basic/source/inc/runtime.hxx  |   14 +--
 basic/source/inc/sbunoobj.hxx |   26 ++--
 basic/source/inc/scanner.hxx  |   18 +++---
 basic/source/inc/symtbl.hxx   |   10 +++
 basic/source/inc/token.hxx|4 +--
 basic/source/runtime/ddectrl.cxx  |2 -
 basic/source/runtime/ddectrl.hxx  |2 -
 basic/source/runtime/iosys.cxx|2 -
 basic/source/runtime/runtime.cxx  |4 +--
 basic/source/sbx/sbxdec.cxx   |4 +--
 basic/source/sbx/sbxdec.hxx   |2 -
 include/basic/sbmeth.hxx  |2 -
 include/basic/sbmod.hxx   |6 ++--
 include/basic/sbstar.hxx  |8 +++---
 include/basic/sbx.hxx |2 -
 30 files changed, 96 insertions(+), 96 deletions(-)

New commits:
commit f1ec3c675f1fcb04de564861c24f26b2bac4244c
Author: Noel Grandin 
AuthorDate: Tue Sep 3 11:47:17 2019 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 3 15:14:00 2019 +0200

loplugin:constmethod in basic

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

diff --git a/basic/inc/sbobjmod.hxx b/basic/inc/sbobjmod.hxx
index a00c849bfee6..64c5784d7b0b 100644
--- a/basic/inc/sbobjmod.hxx
+++ b/basic/inc/sbobjmod.hxx
@@ -76,7 +76,7 @@ public:
 void triggerLayoutEvent();
 void triggerResizeEvent();
 
-bool getInitState()
+bool getInitState() const
 { return mbInit; }
 void setInitState( bool bInit )
 { mbInit = bInit; }
diff --git a/basic/inc/sbprop.hxx b/basic/inc/sbprop.hxx
index f1f7352e9c70..383b4d914e2a 100644
--- a/basic/inc/sbprop.hxx
+++ b/basic/inc/sbprop.hxx
@@ -52,7 +52,7 @@ public:
 , mbSet( false )
 {}
 
-bool isSet()
+bool isSet() const
 { return mbSet; }
 void setSet( bool bSet )
 { mbSet = bSet; }
diff --git a/basic/qa/cppunit/basictest.cxx b/basic/qa/cppunit/basictest.cxx
index 07ce6384539f..8b0670d41dad 100644
--- a/basic/qa/cppunit/basictest.cxx
+++ b/basic/qa/cppunit/basictest.cxx
@@ -109,7 +109,7 @@ bool MacroSnippet::Compile()
 return !mbError;
 }
 
-bool MacroSnippet::HasError() { return mbError; }
+bool MacroSnippet::HasError() const { return mbError; }
 
 IMPL_LINK( MacroSnippet, BasicErrorHdl, StarBASIC *, /*pBasic*/, bool)
 {
diff --git a/basic/qa/cppunit/basictest.hxx b/basic/qa/cppunit/basictest.hxx
index d435489846fb..8b92acf93d69 100644
--- a/basic/qa/cppunit/basictest.hxx
+++ b/basic/qa/cppunit/basictest.hxx
@@ -45,7 +45,7 @@ public:
 
 DECL_LINK( BasicErrorHdl, StarBASIC *, bool );
 
-bool HasError();
+bool HasError() const;
 };
 
 #endif
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index a8707a825d0f..d5fc199e792e 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -377,7 +377,7 @@ public:
 
 static BasicLibInfo*Create( SotStorageStream& rSStream );
 
-const uno::Reference< script::XLibraryContainer >& GetLibraryContainer()
+const uno::Reference< script::XLibraryContainer >& GetLibraryContainer() 
const
 { return mxScriptCont; }
 void SetLibraryContainer( const uno::Reference< script::XLibraryContainer 
>& xScriptCont )
 { mxScriptCont = xScriptCont; }
diff --git a/basic/source/classes/sbunoobj.cxx 
b/basic/source/classes/sbunoobj.cxx
index 6e04394d5d99..3b698965abd0 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -4881,7 +4881,7 @@ StructRefInfo SbUnoStructRefObject::getStructMember( 
const OUString& rMemberName
 return aRet;
 }
 
-OUString SbUnoStructRefObject::getDbgObjectName()
+OUString SbUnoStructRefObject::getDbgObjectName() const
 {
 OUString aName = GetClassName();
 if( aName.isEmpty() )
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 74f96ac2740c..35fdb4bd0937 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1658,7 +1658,7 @@ public:
 StarBASIC::SetGlobalErrorHdl(mErrHandler);
 }
 DECL_LINK( BasicErrorHdl, StarBASIC *, bool );
-bool HasError() { return mbError; }
+bool HasError() const { return mbError; }
 };
 
 IMPL_LINK( 

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

2017-10-09 Thread Mike Kaganski
 basic/inc/sb.hxx   |2 +-
 basic/qa/cppunit/test_scanner.cxx  |2 +-
 basic/source/basmgr/basicmanagerrepository.cxx |6 +++---
 basic/source/basmgr/basmgr.cxx |4 ++--
 basic/source/classes/errobject.cxx |6 +++---
 basic/source/classes/global.cxx|2 +-
 basic/source/classes/image.cxx |4 ++--
 basic/source/classes/propacc.cxx   |2 +-
 basic/source/classes/sb.cxx|   24 
 basic/source/classes/sbintern.cxx  |   12 ++--
 basic/source/classes/sbunoobj.cxx  |2 +-
 basic/source/classes/sbxmod.cxx|   22 +++---
 basic/source/comp/basiccharclass.cxx   |2 +-
 basic/source/comp/buffer.cxx   |4 ++--
 basic/source/comp/codegen.cxx  |6 +++---
 basic/source/comp/dim.cxx  |4 ++--
 basic/source/comp/exprgen.cxx  |6 +++---
 basic/source/comp/exprnode.cxx |6 +++---
 basic/source/comp/exprtree.cxx |4 ++--
 basic/source/comp/io.cxx   |4 ++--
 basic/source/comp/loops.cxx|2 +-
 basic/source/comp/parser.cxx   |2 +-
 basic/source/comp/sbcomp.cxx   |6 +++---
 basic/source/comp/scanner.cxx  |6 +++---
 basic/source/comp/symtbl.cxx   |2 +-
 basic/source/comp/token.cxx|6 +++---
 basic/source/inc/codegen.hxx   |4 ++--
 basic/source/inc/dlgcont.hxx   |2 +-
 basic/source/inc/errobject.hxx |2 +-
 basic/source/inc/expr.hxx  |4 ++--
 basic/source/inc/image.hxx |2 +-
 basic/source/inc/opcodes.hxx   |2 +-
 basic/source/inc/parser.hxx|6 +++---
 basic/source/inc/runtime.hxx   |2 +-
 basic/source/inc/sbintern.hxx  |2 +-
 basic/source/inc/scriptcont.hxx|2 +-
 basic/source/inc/token.hxx |2 +-
 basic/source/runtime/basrdll.cxx   |2 +-
 basic/source/runtime/inputbox.cxx  |6 +++---
 basic/source/runtime/iosys.cxx |6 +++---
 basic/source/runtime/methods.cxx   |   22 +++---
 basic/source/runtime/methods1.cxx  |   16 
 basic/source/runtime/props.cxx |8 
 basic/source/runtime/runtime.cxx   |   18 +-
 basic/source/runtime/stdobj.cxx|   10 +-
 basic/source/runtime/stdobj1.cxx   |4 ++--
 basic/source/sbx/sbxarray.cxx  |2 +-
 basic/source/sbx/sbxbase.cxx   |2 +-
 basic/source/sbx/sbxdate.cxx   |2 +-
 basic/source/sbx/sbxdbl.cxx|2 +-
 basic/source/sbx/sbxscan.cxx   |8 
 basic/source/sbx/sbxstr.cxx|2 +-
 basic/source/sbx/sbxvalue.cxx  |4 ++--
 basic/source/sbx/sbxvar.cxx|4 ++--
 basic/source/uno/dlgcont.cxx   |2 +-
 basic/source/uno/namecont.cxx  |2 +-
 basic/source/uno/scriptcont.cxx|2 +-
 57 files changed, 151 insertions(+), 151 deletions(-)

New commits:
commit daf7c3e7329f343afdcfc72b3c3b88d6b23f0690
Author: Mike Kaganski 
Date:   Mon Oct 9 17:04:39 2017 +0300

basic: consistently use "" and <> in include directives

Change-Id: I147c0e9b9b1e09af593f54799e45e1348cd40716
Reviewed-on: https://gerrit.libreoffice.org/43298
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/basic/inc/sb.hxx b/basic/inc/sb.hxx
index ce78553c8071..191b37a854c9 100644
--- a/basic/inc/sb.hxx
+++ b/basic/inc/sb.hxx
@@ -26,7 +26,7 @@
 #include 
 #include 
 
-#include "sbprop.hxx"
+#include 
 
 // create object from user-type  (+StringID+StringID)
 SbxObject* createUserTypeImpl( const OUString& rClassName );
diff --git a/basic/qa/cppunit/test_scanner.cxx 
b/basic/qa/cppunit/test_scanner.cxx
index 1d6c7f37d4f2..3560938295f5 100644
--- a/basic/qa/cppunit/test_scanner.cxx
+++ b/basic/qa/cppunit/test_scanner.cxx
@@ -17,7 +17,7 @@
 #include 
 #include 
 
-#include "scanner.hxx"
+#include 
 
 namespace
 {
diff --git a/basic/source/basmgr/basicmanagerrepository.cxx 
b/basic/source/basmgr/basicmanagerrepository.cxx
index be1e1ca4edb9..7140cf748a28 100644
--- a/basic/source/basmgr/basicmanagerrepository.cxx
+++ b/basic/source/basmgr/basicmanagerrepository.cxx
@@ -19,10 +19,10 @@
 
 #include 
 #include 
-#include "scriptcont.hxx"
-#include "dlgcont.hxx"
+#include 
+#include 
 #include 

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

2016-06-26 Thread Noel Grandin
 basic/inc/sbprop.hxx|1 -
 basic/qa/cppunit/basic_coverage.cxx |4 +---
 basic/source/basmgr/basmgr.cxx  |   17 -
 basic/source/classes/sbxmod.cxx |1 -
 basic/source/comp/scanner.cxx   |1 -
 basic/source/inc/scanner.hxx|1 -
 6 files changed, 5 insertions(+), 20 deletions(-)

New commits:
commit cea4c1afdf4ae0cbda8ae531f2e26d911d0fd6e1
Author: Noel Grandin 
Date:   Fri Jun 24 12:08:25 2016 +0200

loplugin:singlevalfields in basic and fix leak

And fix leak in BasicManagerImpl where it would never have freed
the streams.

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

diff --git a/basic/inc/sbprop.hxx b/basic/inc/sbprop.hxx
index 09138ae..fbeb138 100644
--- a/basic/inc/sbprop.hxx
+++ b/basic/inc/sbprop.hxx
@@ -32,7 +32,6 @@ class BASIC_DLLPUBLIC SbProperty : public SbxProperty
 friend class SbModule;
 friend class SbProcedureProperty;
 SbModule* pMod;
-bool bInvalid;
 BASIC_DLLPRIVATE SbProperty( const OUString&, SbxDataType, SbModule* );
 virtual ~SbProperty();
 public:
diff --git a/basic/qa/cppunit/basic_coverage.cxx 
b/basic/qa/cppunit/basic_coverage.cxx
index 275fdb9..39a8ebc 100644
--- a/basic/qa/cppunit/basic_coverage.cxx
+++ b/basic/qa/cppunit/basic_coverage.cxx
@@ -21,7 +21,6 @@ class Coverage : public test::BootstrapFixture
 {
 private:
 int  m_nb_tests_ok;
-int  m_nb_tests_skipped;
 OUString m_sCurrentTest;
 void process_directory(const OUString& sDirName);
 void run_test(const OUString& sFileName);
@@ -48,13 +47,12 @@ public:
 Coverage::Coverage()
 : BootstrapFixture(true, false)
 , m_nb_tests_ok(0)
-, m_nb_tests_skipped(0)
 {
 }
 
 Coverage::~Coverage()
 {
-fprintf(stderr,"basic coverage Summary : skipped:%d pass:%d\n", 
m_nb_tests_skipped, m_nb_tests_ok );
+fprintf(stderr,"basic coverage Summary : pass:%d\n", m_nb_tests_ok );
 }
 
 void Coverage::test_failed()
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 918d61d..aeba2e6 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -107,16 +108,13 @@ struct BasicManagerImpl
 
 // Save stream data
 SvMemoryStream*  mpManagerStream;
-SvMemoryStream** mppLibStreams;
-sal_Int32mnLibStreamCount;
+std::vector maLibStreams;
 
 std::vector aLibs;
 OUString aBasicLibPath;
 
 BasicManagerImpl()
 : mpManagerStream( nullptr )
-, mppLibStreams( nullptr )
-, mnLibStreamCount( 0 )
 {}
 ~BasicManagerImpl();
 };
@@ -124,12 +122,6 @@ struct BasicManagerImpl
 BasicManagerImpl::~BasicManagerImpl()
 {
 delete mpManagerStream;
-if( mppLibStreams )
-{
-for( sal_Int32 i = 0 ; i < mnLibStreamCount ; i++ )
-delete mppLibStreams[i];
-delete[] mppLibStreams;
-}
 }
 
 
@@ -539,13 +531,12 @@ BasicManager::BasicManager( SotStorage& rStorage, const 
OUString& rBaseURL, Star
 if( xBasicStorage.Is() && !xBasicStorage->GetError() )
 {
 sal_uInt16 nLibs = GetLibCount();
-mpImpl->mppLibStreams = new SvMemoryStream*[ nLibs ];
 for( sal_uInt16 nL = 0; nL < nLibs; nL++ )
 {
 BasicLibInfo& rInfo = *mpImpl->aLibs[nL];
 tools::SvRef xBasicStream = 
xBasicStorage->OpenSotStream( rInfo.GetLibName(), eStreamReadMode );
-mpImpl->mppLibStreams[nL] = new SvMemoryStream();
-xBasicStream->ReadStream( *( mpImpl->mppLibStreams[nL] ) );
+
mpImpl->maLibStreams.push_back(o3tl::make_unique());
+xBasicStream->ReadStream( *mpImpl->maLibStreams.back() );
 }
 }
 }
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 7970f04..f36b9bf 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -2719,7 +2719,6 @@ SbUserFormModule::Find( const OUString& rName, 
SbxClassType t )
 SbProperty::SbProperty( const OUString& r, SbxDataType t, SbModule* p )
 : SbxProperty( r, t ), pMod( p )
 {
-bInvalid = false;
 }
 
 SbProperty::~SbProperty()
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index 6dfe2c5..968458f 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -31,7 +31,6 @@ SbiScanner::SbiScanner( const OUString& rBuf, StarBASIC* p ) 
: aBuf( rBuf )
 eScanType = SbxVARIANT;
 nErrors  = 0;
 nBufPos  = 0;
-nCurCol1 = 0;
 nSavedCol1 = 0;
 nColLock = 0;
 nLine= 0;
diff --git a/basic/source/inc/scanner.hxx b/basic/source/inc/scanner.hxx
index 

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

2015-07-20 Thread Noel Grandin
 basic/inc/sbobjmod.hxx |   10 
 basic/qa/cppunit/basictest.hxx |4 
 basic/source/basmgr/basicmanagerrepository.cxx |4 
 basic/source/classes/global.cxx|2 
 basic/source/classes/propacc.cxx   |   28 -
 basic/source/classes/sb.cxx|2 
 basic/source/classes/sbunoobj.cxx  |   16 
 basic/source/classes/sbxmod.cxx|8 
 basic/source/comp/codegen.cxx  |6 
 basic/source/comp/parser.cxx   |4 
 basic/source/inc/date.hxx  |   12 
 basic/source/inc/dlgcont.hxx   |   59 +-
 basic/source/inc/errobject.hxx |8 
 basic/source/inc/namecont.hxx  |  497 -
 basic/source/inc/propacc.hxx   |   69 +--
 basic/source/inc/runtime.hxx   |6 
 basic/source/inc/sbunoobj.hxx  |   80 ++--
 basic/source/inc/scriptcont.hxx|   87 ++--
 basic/source/runtime/comenumwrapper.hxx|   10 
 basic/source/runtime/methods.cxx   |   30 -
 basic/source/runtime/methods1.cxx  |4 
 basic/source/runtime/runtime.cxx   |6 
 basic/source/sbx/sbxdec.cxx|4 
 basic/source/sbx/sbxdec.hxx|4 
 basic/source/sbx/sbxvalue.cxx  |4 
 basic/source/sbx/sbxvar.cxx|2 
 basic/source/uno/dlgcont.cxx   |   13 
 basic/source/uno/namecont.cxx  |   12 
 basic/source/uno/scriptcont.cxx|   18 
 29 files changed, 496 insertions(+), 513 deletions(-)

New commits:
commit b4ee16da65eab7b50b29dcd42dc0f0be6b97b174
Author: Noel Grandin n...@peralex.com
Date:   Mon Jul 20 09:21:24 2015 +0200

com::sun::star-css in basic

Change-Id: I637fd7aedeb97b7dca22521474a54a1d4274f212
Reviewed-on: https://gerrit.libreoffice.org/17206
Reviewed-by: Noel Grandin noelgran...@gmail.com
Tested-by: Noel Grandin noelgran...@gmail.com

diff --git a/basic/inc/sbobjmod.hxx b/basic/inc/sbobjmod.hxx
index c71c20a..0b178ae 100644
--- a/basic/inc/sbobjmod.hxx
+++ b/basic/inc/sbobjmod.hxx
@@ -38,21 +38,21 @@ protected:
 
 public:
 TYPEINFO_OVERRIDE();
-SbObjModule( const OUString rName, const 
com::sun::star::script::ModuleInfo mInfo, bool bIsVbaCompatible );
+SbObjModule( const OUString rName, const css::script::ModuleInfo mInfo, 
bool bIsVbaCompatible );
 virtual SbxVariable* Find( const OUString rName, SbxClassType t ) 
SAL_OVERRIDE;
 
 virtual void Notify( SfxBroadcaster rBC, const SfxHint rHint ) 
SAL_OVERRIDE;
 
 using SbxValue::GetObject;
 SbxVariable* GetObject();
-void SetUnoObject( const com::sun::star::uno::Any aObj )throw ( 
com::sun::star::uno::RuntimeException, std::exception ) ;
+void SetUnoObject( const css::uno::Any aObj )throw ( 
css::uno::RuntimeException, std::exception ) ;
 };
 
 class FormObjEventListenerImpl;
 
 class BASIC_DLLPUBLIC SbUserFormModule : public SbObjModule
 {
-com::sun::star::script::ModuleInfo m_mInfo;
+css::script::ModuleInfo m_mInfo;
 ::rtl::Reference FormObjEventListenerImpl  m_DialogListener;
 css::uno::Referencecss::awt::XDialog m_xDialog;
 css::uno::Referencecss::frame::XModel m_xModel;
@@ -62,7 +62,7 @@ class BASIC_DLLPUBLIC SbUserFormModule : public SbObjModule
 void InitObject();
 public:
 TYPEINFO_OVERRIDE();
-SbUserFormModule( const OUString rName, const 
com::sun::star::script::ModuleInfo mInfo, bool bIsVBACompat );
+SbUserFormModule( const OUString rName, const css::script::ModuleInfo 
mInfo, bool bIsVBACompat );
 virtual ~SbUserFormModule();
 virtual SbxVariable* Find( const OUString rName, SbxClassType t ) 
SAL_OVERRIDE;
 void ResetApiObj( bool bTriggerTerminateEvent = true );
@@ -91,7 +91,7 @@ class BASIC_DLLPUBLIC SbUserFormModuleInstance : public 
SbUserFormModule
 
 public:
 SbUserFormModuleInstance( SbUserFormModule* pParentModule, const OUString 
rName,
-const com::sun::star::script::ModuleInfo mInfo, bool bIsVBACompat );
+const css::script::ModuleInfo mInfo, bool bIsVBACompat );
 
 virtual bool IsClass( const OUString ) const SAL_OVERRIDE;
 virtual SbxVariable* Find( const OUString rName, SbxClassType t ) 
SAL_OVERRIDE;
diff --git a/basic/qa/cppunit/basictest.hxx b/basic/qa/cppunit/basictest.hxx
index 1b9c634..49bbb29 100644
--- a/basic/qa/cppunit/basictest.hxx
+++ b/basic/qa/cppunit/basictest.hxx
@@ -88,7 +88,7 @@ class MacroSnippet
 MakeModule( sSource );
 }
 
-SbxVariableRef Run( const ::com::sun::star::uno::Sequence 
::com::sun::star::uno::Any  rArgs )
+SbxVariableRef Run( const css::uno::Sequence css::uno::Any  rArgs )
 {
 SbxVariableRef pReturn = NULL;
 if ( !Compile() )
@@ -114,7 +114,7 @@ class MacroSnippet
 
 SbxVariableRef Run()
 {
-