[Libreoffice-commits] core.git: Branch 'aoo/trunk' - basic/source
Damjan Jovanovic
damjan at apache.org
Mon Dec 14 22:09:20 PST 2015
basic/source/runtime/methods.cxx | 15 +++++++++++++++
basic/source/runtime/rtlproto.hxx | 1 +
basic/source/runtime/stdobj.cxx | 2 +-
3 files changed, 17 insertions(+), 1 deletion(-)
New commits:
commit fa1315d25186643ea537972609c117e0c9bb1fbc
Author: Damjan Jovanovic <damjan at apache.org>
Date: Tue Dec 15 04:40:45 2015 +0000
#i19221# Print Tab(5); "Hello" does not work
Implement the Tab() function in AOO Basic.
Patch by: me
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 79c6cbf..26d4fd9 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1708,6 +1708,21 @@ RTLFUNC(String)
}
}
+RTLFUNC(Tab)
+{
+ (void)pBasic;
+ (void)bWrite;
+
+ if ( rPar.Count() < 2 )
+ StarBASIC::Error( SbERR_BAD_ARGUMENT );
+ else
+ {
+ String aStr;
+ aStr.Fill( (sal_uInt16)(rPar.Get(1)->GetLong() ), '\t');
+ rPar.Get(0)->PutString( aStr );
+ }
+}
+
RTLFUNC(Tan)
{
(void)pBasic;
diff --git a/basic/source/runtime/rtlproto.hxx b/basic/source/runtime/rtlproto.hxx
index 12775db..92a8842 100644
--- a/basic/source/runtime/rtlproto.hxx
+++ b/basic/source/runtime/rtlproto.hxx
@@ -193,6 +193,7 @@ extern RTLFUNC(Str);
extern RTLFUNC(StrComp);
extern RTLFUNC(String);
extern RTLFUNC(StrReverse);
+extern RTLFUNC(Tab);
extern RTLFUNC(Tan);
extern RTLFUNC(UCase);
extern RTLFUNC(Val);
diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx
index eb3cdcc..7a18184 100644
--- a/basic/source/runtime/stdobj.cxx
+++ b/basic/source/runtime/stdobj.cxx
@@ -521,7 +521,7 @@ static Methods aMethods[] = {
{ "Switch", SbxVARIANT, 2 | _FUNCTION, RTLNAME(Switch),0 },
{ "Expression", SbxVARIANT, 0,NULL,0 },
{ "Value", SbxVARIANT, 0,NULL,0 },
-
+{ "Tab", SbxSTRING, 1 | _FUNCTION, RTLNAME(Tab),0 },
{ "Tan", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Tan),0 },
{ "number", SbxDOUBLE, 0,NULL,0 },
{ "Time", SbxVARIANT, _LFUNCTION,RTLNAME(Time),0 },
More information about the Libreoffice-commits
mailing list