diff options
author | Damjan Jovanovic <damjan@apache.org> | 2015-12-15 04:40:45 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-12-15 13:48:28 +0000 |
commit | 98f0e0eda50690bd01842c806bd13e3bc5af2966 (patch) | |
tree | d6c5d85aaae21d365bd8731bc7c4e93b9619d031 /basic | |
parent | f2996d8f4573a2cdb1621215d721983891759aa2 (diff) |
Resolves: #i19221# Print Tab(5); "Hello" does not work
Implement the Tab() function in AOO Basic.
Patch by: me
(cherry picked from commit fa1315d25186643ea537972609c117e0c9bb1fbc)
Change-Id: Ifa9843661ce3862347c6351a078ddb207169182a
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/inc/rtlproto.hxx | 1 | ||||
-rw-r--r-- | basic/source/runtime/methods.cxx | 15 | ||||
-rw-r--r-- | basic/source/runtime/stdobj.cxx | 2 |
3 files changed, 17 insertions, 1 deletions
diff --git a/basic/source/inc/rtlproto.hxx b/basic/source/inc/rtlproto.hxx index 7324e118550c..aceff7393dfe 100644 --- a/basic/source/inc/rtlproto.hxx +++ b/basic/source/inc/rtlproto.hxx @@ -199,6 +199,7 @@ extern RTLFUNC(StrComp); extern RTLFUNC(String); extern RTLFUNC(StrReverse); extern RTLFUNC(SYD); +extern RTLFUNC(Tab); extern RTLFUNC(Tan); extern RTLFUNC(UCase); extern RTLFUNC(Val); diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index aad84105a293..fb0732903d4c 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -1725,6 +1725,21 @@ RTLFUNC(String) } } +RTLFUNC(Tab) +{ + (void)pBasic; + (void)bWrite; + + if ( rPar.Count() < 2 ) + StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); + else + { + OUStringBuffer aStr; + comphelper::string::padToLength(aStr, rPar.Get(1)->GetLong(), '\t'); + rPar.Get(0)->PutString(aStr.makeStringAndClear()); + } +} + RTLFUNC(Tan) { (void)pBasic; diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx index b6d7d5d11ff8..db0275c37d55 100644 --- a/basic/source/runtime/stdobj.cxx +++ b/basic/source/runtime/stdobj.cxx @@ -603,7 +603,7 @@ static Methods aMethods[] = { { "Switch", SbxVARIANT, 2 | _FUNCTION, RTLNAME(Switch),0 }, { "Expression", SbxVARIANT, 0,nullptr,0 }, { "Value", SbxVARIANT, 0,nullptr,0 }, - +{ "Tab", SbxSTRING, 1 | _FUNCTION, RTLNAME(Tab),0 }, { "Tan", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Tan),0 }, { "number", SbxDOUBLE, 0,nullptr,0 }, { "Time", SbxVARIANT, _LFUNCTION,RTLNAME(Time),0 }, |