You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ms...@apache.org on 2022/08/09 08:36:37 UTC
[openoffice] 01/02: #i19221# Print Tab(5); "Hello" does not work
This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit aab0785ab1a35e3f18ee77a8bea2a593ba138404
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: 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
git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1720071 13f79535-47bb-0310-9956-ffa450edef68
(cherry picked from commit 710acb7fec04e2be4f9e8dd01b61043205894bd5)
---
main/basic/source/runtime/methods.cxx | 15 +++++++++++++++
main/basic/source/runtime/rtlproto.hxx | 1 +
main/basic/source/runtime/stdobj.cxx | 2 +-
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/main/basic/source/runtime/methods.cxx b/main/basic/source/runtime/methods.cxx
index e32529dc5c..e2d42b9308 100644
--- a/main/basic/source/runtime/methods.cxx
+++ b/main/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/main/basic/source/runtime/rtlproto.hxx b/main/basic/source/runtime/rtlproto.hxx
index 949a2ffe66..426ef17aab 100644
--- a/main/basic/source/runtime/rtlproto.hxx
+++ b/main/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/main/basic/source/runtime/stdobj.cxx b/main/basic/source/runtime/stdobj.cxx
index c559c1c8a8..9a9c28e96f 100644
--- a/main/basic/source/runtime/stdobj.cxx
+++ b/main/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 },