20#include <config_features.h>
25#include <osl/process.h>
35#include <rtl/character.hxx>
36#include <rtl/math.hxx>
44#include <rtl/string.hxx>
50#include <osl/file.hxx>
56#include <com/sun/star/uno/Sequence.hxx>
57#include <com/sun/star/util/DateTime.hpp>
58#include <com/sun/star/lang/Locale.hpp>
59#include <com/sun/star/lang/XServiceInfo.hpp>
60#include <com/sun/star/ucb/SimpleFileAccess.hpp>
61#include <com/sun/star/script/XErrorQuery.hpp>
62#include <ooo/vba/VbStrConv.hpp>
63#include <ooo/vba/VbTriState.hpp>
64#include <com/sun/star/bridge/oleautomation/XAutomationObject.hpp>
71#include <com/sun/star/i18n/Transliteration.hpp>
72#include <com/sun/star/util/SearchAlgorithms2.hpp>
116#if HAVE_FEATURE_SCRIPTING
118static void FilterWhiteSpace( OUString& rStr )
126 for (sal_Int32 i = 0;
i < rStr.getLength(); ++
i)
129 if ((cChar !=
' ') && (cChar !=
'\t') &&
130 (cChar !=
'\n') && (cChar !=
'\r'))
136 rStr = aRet.makeStringAndClear();
145static bool isFolder( FileStatus::Type aType )
147 return ( aType == FileStatus::Directory || aType == FileStatus::Volume );
163 if( aFileURL.isEmpty() )
165 File::getFileURLFromSystemPath( aRelPath, aFileURL );
172static uno::Reference< ucb::XSimpleFileAccess3 >
const & getFileAccess()
186 if( rPar.
Count() < 2 )
195 p->SetParent( pBasic );
209 if (rPar.
Count() == 1)
228 if( bVBA && !aErrorMsg.isEmpty())
230 tmpErrMsg = aErrorMsg;
240 if (bVBA && rPar.
Count() > 1)
243 if ( xErrObj.is() && xErrObj->getNumber() == nCode && !xErrObj->getDescription().isEmpty() )
245 tmpErrMsg = xErrObj->getDescription();
255 if (rPar.
Count() < 2)
265 if (rPar.
Count() < 2)
275 if (rPar.
Count() < 2)
285 if (rPar.
Count() < 2)
295 if (rPar.
Count() < 2)
299 OUString
aStr( pArg->GetOUString() );
310static void implChr(
SbxArray& rPar,
bool bChrW )
312 if (rPar.
Count() < 2)
320 char c =
static_cast<char>(pArg->GetByte());
321 aStr = OUString(&c, 1, osl_getThreadTextEncoding());
328 sal_Int32 aCh = pArg->GetLong();
329 if (aCh < -0x8000 || aCh > 0xFFFF)
341 implChr( rPar,
false );
346 implChr( rPar,
true );
353extern "C" void invalidParameterHandler(
354 wchar_t const * expression,
wchar_t const * function,
wchar_t const * file,
unsigned int line,
359 "invalid parameter during _wgetdcwd; \""
360 << (expression ? OUString(o3tl::toU(expression)) : OUString(
"???"))
361 <<
"\" (" << (function ? OUString(o3tl::toU(function)) : OUString(
"???")) <<
") at "
362 << (file ? OUString(o3tl::toU(file)) : OUString(
"???")) <<
":" << line);
378 if (rPar.
Count() == 2)
381 if ( aDrive.getLength() != 1 )
386 auto c = rtl::toAsciiUpperCase(aDrive[0]);
387 if ( !rtl::isAsciiUpperCase( c ) )
392 nCurDir = c -
'A' + 1;
398 auto const handler = _set_thread_local_invalid_parameter_handler(&invalidParameterHandler);
399 auto const ok = _wgetdcwd( nCurDir, pBuffer, _MAX_PATH ) !=
nullptr;
400 _set_thread_local_invalid_parameter_handler(handler);
412 const int PATH_INCR = 250;
414 int nSize = PATH_INCR;
415 std::unique_ptr<char[]> pMem;
418 pMem.reset(
new char[nSize]);
424 if( getcwd( pMem.get(), nSize-1 ) !=
nullptr )
426 rPar.
Get(0)->
PutString(OUString::createFromAscii(pMem.get()));
429 if( errno != ERANGE )
443 if (rPar.
Count() == 2)
461 if (rPar.
Count() != 2)
471 const uno::Reference< ucb::XSimpleFileAccess3 >& xSFI = getFileAccess();
478 if( !xSFI->exists( aSourceFullPath ) )
485 if( xSFI->exists( aDestFullPath ) )
491 xSFI->move( aSourceFullPath, aDestFullPath );
494 catch(
const Exception & )
504 if( nRet != FileBase::E_None )
513 if (rPar.
Count() == 3)
519 const uno::Reference< ucb::XSimpleFileAccess3 >& xSFI = getFileAccess();
526 catch(
const Exception & )
535 if( nRet != FileBase::E_None )
548 if (rPar.
Count() == 2)
554 const uno::Reference< ucb::XSimpleFileAccess3 >& xSFI = getFileAccess();
558 if( !xSFI->exists( aFullPath ) || xSFI->isFolder( aFullPath ) )
565 xSFI->kill( aFullPath );
567 catch(
const Exception & )
587 if (rPar.
Count() == 2)
595 if ( aURLObj.GetProtocol() != INetProtocol::File )
600 pPar->Insert(pResult.
get(), pPar->Count());
601 pPar->Insert(pParam.
get(), pPar->Count());
604 OUString sCurPathURL;
605 File::getFileURLFromSystemPath(pPar->Get(0)->GetOUString(), sCurPathURL);
607 aURLObj.SetURL( sCurPathURL );
608 aURLObj.Append( aPath );
615 const uno::Reference< ucb::XSimpleFileAccess3 >& xSFI = getFileAccess();
622 catch(
const Exception & )
640static void implRemoveDirRecursive(
const OUString& aDirPath )
643 FileBase::RC nRet = DirectoryItem::get( aDirPath, aItem );
644 bool bExists = (nRet == FileBase::E_None);
646 FileStatus aFileStatus( osl_FileStatus_Mask_Type );
647 nRet = aItem.getFileStatus( aFileStatus );
648 bool bFolder = nRet == FileBase::E_None
649 && isFolder( aFileStatus.getFileType() );
651 if( !bExists || !bFolder )
656 Directory aDir( aDirPath );
658 if( nRet != FileBase::E_None )
671 if (rPar.
Count() == 2)
676 const uno::Reference< ucb::XSimpleFileAccess3 >& xSFI = getFileAccess();
681 if( !xSFI->isFolder( aPath ) )
690 if( aContent.hasElements() )
698 catch(
const Exception & )
723 if (rPar.
Count() < 2)
727 aDouble = exp( aDouble );
734 if (rPar.
Count() < 2)
740 OUString
aStr( pArg->GetOUString() );
744 const uno::Reference< ucb::XSimpleFileAccess3 >& xSFI = getFileAccess();
751 catch(
const Exception & )
760 (void)DirectoryItem::get(
getFullPath( aStr ), aItem );
761 FileStatus aFileStatus( osl_FileStatus_Mask_FileSize );
762 (void)aItem.getFileStatus( aFileStatus );
763 nLen =
static_cast<sal_Int32
>(aFileStatus.getFileSize());
772 if (rPar.
Count() < 2)
779 sal_uInt32 nVal = pArg->IsInteger() ?
780 static_cast<sal_uInt16
>(pArg->GetInteger()) :
781 static_cast<sal_uInt32
>(pArg->GetLong());
782 rPar.
Get(0)->
PutString(OUString::number(nVal, 16).toAsciiUpperCase());
794 *rPar.
Get(0) = *pVar;
807 const sal_uInt32 nArgCount = rPar.
Count() - 1;
812 sal_Int32 nStartPos = 1;
813 sal_Int32 nFirstStringPos = 1;
815 if ( nArgCount >= 3 )
838 if ( nArgCount == 4 )
843 const OUString& rToken = rPar.
Get(nFirstStringPos + 1)->
GetOUString();
846 if( rToken.isEmpty() )
853 const sal_Int32 nrStr1Len = rStr1.getLength();
854 if (nStartPos > nrStr1Len)
863 nPos = rStr1.indexOf( rToken, nStartPos - 1 ) + 1;
870 aSearchOptions.
AlgorithmType2 = util::SearchAlgorithms2::ABSOLUTE;
874 sal_Int32 nStart = nStartPos - 1;
875 sal_Int32 nEnd = nrStr1Len;
876 nPos = textSearch.SearchForward(rStr1, &nStart, &nEnd) ? nStart + 1 : 0;
889 const sal_uInt32 nArgCount = rPar.
Count() - 1;
898 sal_Int32 nStartPos = -1;
899 if ( nArgCount >= 3 )
902 if( nStartPos <= 0 && nStartPos != -1 )
921 if ( nArgCount == 4 )
925 const sal_Int32 nStrLen = aStr1.getLength();
926 if( nStartPos == -1 )
932 if( nStartPos <= nStrLen )
934 sal_Int32 nTokenLen = aToken.getLength();
940 else if( nStrLen > 0 )
944 nPos = aStr1.lastIndexOf( aToken, nStartPos ) + 1;
951 aSearchOptions.
AlgorithmType2 = util::SearchAlgorithms2::ABSOLUTE;
955 sal_Int32 nStart = 0;
956 sal_Int32 nEnd = nStartPos;
957 nPos = textSearch.SearchBackward(aStr1, &nEnd, &nStart) ? nStart : 0;
974 if (rPar.
Count() < 2)
978 double aDouble= pArg->GetDouble();
983 aDouble = floor( aDouble );
990 if (rPar.
Count() < 2)
994 double aDouble = pArg->GetDouble();
995 if ( aDouble >= 0.0 )
996 aDouble = floor( aDouble );
998 aDouble = ceil( aDouble );
1005 if (rPar.
Count() < 2)
1008 const CharClass& rCharClass = GetCharClass();
1016 if (rPar.
Count() < 3)
1023 sal_Int32 nResultLen = rPar.
Get(2)->
GetLong();
1024 if( nResultLen < 0 )
1029 else if(nResultLen >
aStr.getLength())
1031 nResultLen =
aStr.getLength();
1040 if (rPar.
Count() < 2)
1049 double d =
log( aArg );
1062 if (rPar.
Count() < 2)
1078 int nArgCount = rPar.
Count() - 1;
1079 if ( nArgCount < 2 )
1089 if( nArgCount == 4 )
1094 sal_Int32 nStartPos = rPar.
Get(2)->
GetLong();
1095 if ( nStartPos < 1 )
1102 sal_Int32 nLen = -1;
1103 bool bWriteNoLenParam =
false;
1104 if ( nArgCount == 3 || bWrite )
1107 if( bWrite && n == -1 )
1109 bWriteNoLenParam =
true;
1115 sal_Int32 nArgLen = aArgStr.getLength();
1116 if( nStartPos > nArgLen )
1120 if( bCompatibility )
1124 nStartPos = nArgLen;
1128 sal_Int32 nReplaceStrLen = aReplaceStr.getLength();
1129 sal_Int32 nReplaceLen;
1130 if( bWriteNoLenParam )
1132 nReplaceLen = nArgLen - nStartPos;
1137 if( nReplaceLen < 0 || nReplaceLen > nArgLen - nStartPos )
1139 nReplaceLen = nArgLen - nStartPos;
1143 OUStringBuffer aResultStr(aArgStr);
1144 sal_Int32 nErase = nReplaceLen;
1145 aResultStr.remove( nStartPos, nErase );
1147 nStartPos, aReplaceStr.getStr(), std::min(nReplaceLen, nReplaceStrLen));
1149 rPar.
Get(1)->
PutString(aResultStr.makeStringAndClear());
1153 OUString aResultStr;
1154 if (nStartPos > aArgStr.getLength())
1158 else if(nArgCount == 2)
1160 aResultStr = aArgStr.copy( nStartPos);
1166 if(nStartPos + nLen > aArgStr.getLength())
1168 nLen = aArgStr.getLength() - nStartPos;
1171 aResultStr = aArgStr.copy( nStartPos, nLen );
1181 if (rPar.
Count() < 2)
1189 sal_uInt32 nVal = pArg->IsInteger() ?
1190 static_cast<sal_uInt16
>(pArg->GetInteger()) :
1191 static_cast<sal_uInt32
>(pArg->GetLong());
1200 const sal_uInt32 nArgCount = rPar.
Count() - 1;
1201 if ( nArgCount < 3 || nArgCount > 6 )
1206 sal_Int32 lStartPos = 1;
1220 sal_Int32 lCount = -1;
1233 bool bCaseInsensitive;
1248 bCaseInsensitive =
true;
1256 OUString aSrcStr(aExpStr);
1257 sal_Int32 nPrevPos = std::min(lStartPos, aSrcStr.getLength());
1258 css::uno::Sequence<sal_Int32> aOffset;
1259 if (bCaseInsensitive)
1267 xTrans->loadModule(css::i18n::TransliterationModules_IGNORE_CASE, {});
1268 aFindStr = xTrans->transliterate(aFindStr, 0, aFindStr.getLength(), aOffset);
1269 aSrcStr = xTrans->transliterate(aSrcStr, nPrevPos, aSrcStr.getLength() - nPrevPos, aOffset);
1270 nPrevPos = std::distance(aOffset.begin(),
1271 std::lower_bound(aOffset.begin(), aOffset.end(), nPrevPos));
1274 auto getExpStrPos = [aOffset, nExpLen = aExpStr.getLength()](sal_Int32 nSrcStrPos) -> sal_Int32
1276 assert(!aOffset.hasElements() || aOffset.getLength() >= nSrcStrPos);
1277 if (!aOffset.hasElements())
1279 return aOffset.getLength() > nSrcStrPos ? aOffset[nSrcStrPos] : nExpLen;
1283 OUStringBuffer sResult(aSrcStr.getLength() - nPrevPos);
1284 sal_Int32 nCounts = 0;
1285 while (lCount == -1 || lCount > nCounts)
1287 sal_Int32
nPos = aSrcStr.indexOf(aFindStr, nPrevPos);
1291 lStartPos = getExpStrPos(nPrevPos);
1292 sResult.append(aExpStr.getStr() + lStartPos, getExpStrPos(nPos) - lStartPos);
1293 sResult.append(aReplaceStr);
1294 nPrevPos =
nPos + aFindStr.getLength();
1297 lStartPos = getExpStrPos(nPrevPos);
1298 sResult.append(aExpStr.getStr() + lStartPos, aExpStr.getLength() - lStartPos);
1304 if (rPar.
Count() < 3)
1312 if( nResultLen < 0 )
1317 int nStrLen = rStr.getLength();
1318 if ( nResultLen > nStrLen )
1320 nResultLen = nStrLen;
1322 OUString aResultStr = rStr.copy( nStrLen - nResultLen );
1334 if (rPar.
Count() < 2)
1347 if (rPar.
Count() < 2)
1354 sal_Int16 nResult = 0;
1359 else if ( aDouble < 0 )
1369 if (rPar.
Count() < 2)
1376 OUStringBuffer
aBuf(nCount);
1377 string::padToLength(aBuf, nCount,
' ');
1384 if (rPar.
Count() < 2)
1404 if (rPar.
Count() < 2)
1411 OUString aStrNew(
"");
1413 pArg->Format( aStr );
1416 if( pArg->IsNumericRTL() )
1419 aStr =
aStr.replaceFirst(
",",
"." );
1423 if( bCompatibility )
1425 sal_Int32 nLen =
aStr.getLength();
1429 bool bNeg = ( pBuf[0] ==
'-' );
1430 sal_Int32 iZeroSearch = 0;
1438 if( pBuf[0] !=
' ' )
1443 sal_Int32 iNext = iZeroSearch + 1;
1444 if( pBuf[iZeroSearch] ==
'0' && nLen > iNext && pBuf[iNext] ==
'.' )
1448 aStrNew +=
aStr.subView(iZeroSearch);
1452 aStrNew =
" " +
aStr;
1465 if (rPar.
Count() < 3)
1477 if( bCompatibility )
1484 bTextCompare =
true;
1486 if (rPar.
Count() == 4)
1489 if( !bCompatibility )
1491 bTextCompare = !bTextCompare;
1493 sal_Int32 nRetValue = 0;
1497 if( !pTransliterationWrapper )
1501 new ::utl::TransliterationWrapper( xContext,
1502 TransliterationFlags::IGNORE_CASE |
1503 TransliterationFlags::IGNORE_KANA |
1504 TransliterationFlags::IGNORE_WIDTH ) );
1510 nRetValue = pTransliterationWrapper->
compareString( rStr1, rStr2 );
1515 aResult = rStr1.compareTo( rStr2 );
1520 else if ( aResult > 0)
1525 rPar.
Get(0)->
PutInteger(sal::static_int_cast<sal_Int16>(nRetValue));
1530 if (rPar.
Count() < 2)
1538 if( lCount < 0 || lCount > 0xffff )
1551 OUStringBuffer
aBuf(lCount);
1552 string::padToLength(aBuf, lCount, aFiller);
1559 if (rPar.
Count() < 2)
1564 OUStringBuffer
aStr(nCount);
1572 if (rPar.
Count() < 2)
1585 if (rPar.
Count() < 2)
1591 const CharClass& rCharClass = GetCharClass();
1601 if (rPar.
Count() < 2)
1607 double nResult = 0.0;
1612 FilterWhiteSpace( aStr );
1613 if (
aStr.getLength() > 1 && aStr[0] ==
'&' )
1616 char aChar =
static_cast<char>(
aStr[1]);
1617 if ( aChar ==
'h' || aChar ==
'H' )
1621 else if ( aChar ==
'o' || aChar ==
'O' )
1628 sal_Int16 nlResult =
static_cast<sal_Int16
>(strtol( aByteStr.getStr()+2, &pEndPtr, nRadix));
1629 nResult =
static_cast<double>(nlResult);
1634 rtl_math_ConversionStatus eStatus = rtl_math_ConversionStatus_Ok;
1635 sal_Int32 nParseEnd = 0;
1636 nResult = ::rtl::math::stringToDouble( aStr,
'.',
',', &eStatus, &nParseEnd );
1637 if ( eStatus != rtl_math_ConversionStatus_Ok )
1645 else if ( nParseEnd !=
aStr.getLength() )
1658 aDate = floor( aDate );
1659 Date aRefDate(1899'12'30);
1660 aRefDate.AddDays( aDate );
1662 sal_Int16 nRet =
static_cast<sal_Int16
>( aRefDate.GetDay() );
1668 Date aRefDate(1899'12'30);
1669 sal_Int32 nDays =
static_cast<sal_Int32
>(aDate);
1670 aRefDate.AddDays( nDays );
1671 sal_Int16 nRet =
static_cast<sal_Int16
>( aRefDate.GetMonth() );
1677 double aDate = pVal->
GetDate();
1679 css::util::Date aUnoDate;
1699 if (rPar.
Count() != 2)
1716 css::util::Date aUnoDate;
1717 if(aAny >>= aUnoDate)
1725 double aDate = pVal->
GetDate();
1727 css::util::Time aUnoTime;
1731 aUnoTime.NanoSeconds = 0;
1744 if (rPar.
Count() != 2)
1761 css::util::Time aUnoTime;
1762 if(aAny >>= aUnoTime)
1770 double aDate = pVal->
GetDate();
1772 css::util::DateTime aUnoDT;
1779 aUnoDT.NanoSeconds = 0;
1788 aUnoDT.Hours, aUnoDT.Minutes, aUnoDT.Seconds,
1798 if (rPar.
Count() != 2)
1815 css::util::DateTime aUnoDT;
1825 if (rPar.
Count() == 2)
1832 snprintf(
Buffer,
sizeof(
Buffer ), (nYear < 0 ?
"%05d%02d%02d" :
"%04d%02d%02d"),
1833 static_cast<int>(nYear),
1836 OUString aRetStr = OUString::createFromAscii(
Buffer );
1849 if (rPar.
Count() == 2)
1861 sal_Int32 nSign = 1;
1867 const sal_Int32 nLen =
aStr.getLength();
1870 if (nLen == 6 && nSign == -1)
1876 if (nLen != 6 && (nLen < 8 || 11 < nLen))
1879 bool bUseTwoDigitYear =
false;
1880 std::u16string_view aYearStr, aMonthStr, aDayStr;
1881 if (nLen == 6 || nLen == 8 || nLen == 9)
1887 const sal_Int32 nMonthPos = (nLen == 8 ? 4 : (nLen == 6 ? 2 : 5));
1889 bUseTwoDigitYear =
true;
1890 aYearStr =
aStr.subView( 0, nMonthPos );
1891 aMonthStr =
aStr.subView( nMonthPos, 2 );
1892 aDayStr =
aStr.subView( nMonthPos + 2, 2 );
1897 const sal_Int32 nMonthSep = (nLen == 11 ? 5 : 4);
1898 if (
aStr.indexOf(
'-') != nMonthSep)
1900 if (
aStr.indexOf(
'-', nMonthSep + 1) != nMonthSep + 3)
1903 aYearStr =
aStr.subView( 0, nMonthSep );
1904 aMonthStr =
aStr.subView( nMonthSep + 1, 2 );
1905 aDayStr =
aStr.subView( nMonthSep + 4, 2 );
1934 if (rPar.
Count() < 4)
1951 if (rPar.
Count() < 4)
1962 if ((nHour < 0 || nHour > 23) ||
1963 (nMinute < 0 || nMinute > 59 ) ||
1964 (nSecond < 0 || nSecond > 59 ))
1974 if (rPar.
Count() < 2)
1981 std::shared_ptr<SvNumberFormatter> pFormatter;
1993 sal_uInt32
nIndex = pFormatter->GetStandardIndex( eLangType);
1996 bool bSuccess = pFormatter->IsNumberFormat( aStr, nIndex, fResult );
2002 if( !bSuccess && ( eLangType != LANGUAGE_ENGLISH_US ) )
2005 nIndex = pFormatter->GetStandardIndex( LANGUAGE_ENGLISH_US);
2006 bSuccess = pFormatter->IsNumberFormat( aStr, nIndex, fResult );
2007 nType = pFormatter->GetType( nIndex );
2010 if(bSuccess && (nType==SvNumFormatType::DATE || nType==SvNumFormatType::DATETIME))
2012 if ( nType == SvNumFormatType::DATETIME )
2015 if ( fResult > 0.0 )
2017 fResult = floor( fResult );
2021 fResult = ceil( fResult );
2035 if (rPar.
Count() < 2)
2041 std::shared_ptr<SvNumberFormatter> pFormatter;
2052 bool bSuccess = pFormatter->IsNumberFormat(rPar.
Get(1)->
GetOUString(),
2055 if(bSuccess && (nType==SvNumFormatType::TIME||nType==SvNumFormatType::DATETIME))
2057 if ( nType == SvNumFormatType::DATETIME )
2060 fResult = fmod( fResult, 1 );
2073 if (rPar.
Count() < 2)
2080 double aDate = pArg->GetDate();
2089 if (rPar.
Count() < 2)
2102 double nFrac = dDate - floor( dDate );
2104 sal_Int32 nSeconds =
static_cast<sal_Int32
>(nFrac + 0.5);
2105 sal_Int16 nHour =
static_cast<sal_Int16
>(nSeconds / 3600);
2111 if (rPar.
Count() < 2)
2125 if (rPar.
Count() < 2)
2139 if (rPar.
Count() < 2)
2152 double nFrac = dDate - floor( dDate );
2154 sal_Int32 nSeconds =
static_cast<sal_Int32
>(nFrac + 0.5);
2155 sal_Int16 nTemp =
static_cast<sal_Int16
>(nSeconds / 3600);
2156 nSeconds -= nTemp * 3600;
2157 nTemp =
static_cast<sal_Int16
>(nSeconds / 60);
2158 nSeconds -= nTemp * 60;
2160 sal_Int16 nRet =
static_cast<sal_Int16
>(nSeconds);
2166 if (rPar.
Count() < 2)
2181 double aSerial =
static_cast<double>(
GetDayDiff( aDateTime ));
2184 nSeconds += aDateTime.GetMin() * 60;
2185 nSeconds += aDateTime.GetSec();
2186 double nDays =
static_cast<double>(nSeconds) / (24.0*3600.0);
2208 snprintf( buf,
sizeof(buf),
"%02d:%02d:%02d",
2209 aTime.GetHour(), aTime.GetMin(), aTime.GetSec() );
2210 aRes = OUString::createFromAscii( buf );
2217 nSeconds += aTime.GetMin() * 60;
2218 nSeconds += aTime.GetSec();
2219 double nDays =
static_cast<double>(nSeconds) * ( 1.0 / (24.0*3600.0) );
2222 std::shared_ptr<SvNumberFormatter> pFormatter;
2235 pFormatter->GetOutputString( nDays, nIndex, aRes, &pCol );
2250 nSeconds += aTime.GetMin() * 60;
2251 nSeconds += aTime.GetSec();
2252 rPar.
Get(0)->
PutDate(
static_cast<double>(nSeconds));
2261 double nDays =
static_cast<double>(
GetDayDiff( aToday ));
2268 std::shared_ptr<SvNumberFormatter> pFormatter;
2281 pFormatter->GetOutputString( nDays, nIndex, aRes, &pCol );
2297 if (rPar.
Count() < 2)
2309 if (rPar.
Count() < 2)
2319 if(
auto pUnoClass =
dynamic_cast<SbUnoClass*
>( pObj) )
2321 bObject = pUnoClass->getUnoClass().is();
2329 if (rPar.
Count() < 2)
2350 xArg->SbxValue::GetDate();
2363 if (rPar.
Count() < 2)
2376 pVar->
Broadcast( SfxHintId::BasicDataWanted );
2388 if (rPar.
Count() < 2)
2403 uno::Reference< script::XErrorQuery > xError;
2406 xError.set( pObj->
getUnoAny(), uno::UNO_QUERY );
2421 if (rPar.
Count() < 2)
2431 if( !bNull && pArg->GetType() ==
SbxOBJECT )
2433 SbxBase* pObj = pArg->GetObject();
2445 if (rPar.
Count() < 2)
2458 if (rPar.
Count() < 2)
2470static OUString implSetupWildcard(
const OUString& rFileParam,
SbiRTLData& rRTLData)
2472 static const char cDelim1 =
'/';
2473 static const char cDelim2 =
'\\';
2474 static const char cWild1 =
'*';
2475 static const char cWild2 =
'?';
2480 OUString aFileParam = rFileParam;
2481 sal_Int32 nLastWild = aFileParam.lastIndexOf( cWild1 );
2484 nLastWild = aFileParam.lastIndexOf( cWild2 );
2486 bool bHasWildcards = ( nLastWild >= 0 );
2489 sal_Int32 nLastDelim = aFileParam.lastIndexOf( cDelim1 );
2490 if( nLastDelim < 0 )
2492 nLastDelim = aFileParam.lastIndexOf( cDelim2 );
2497 if( nLastDelim >= 0 && nLastDelim > nLastWild )
2505 if( nLastDelim != aFileParam.getLength() - 1 )
2512 OUString aPureFileName;
2513 if( nLastDelim < 0 )
2515 aPureFileName = aFileParam;
2520 aPureFileName = aFileParam.copy( nLastDelim + 1 );
2521 aFileParam = aFileParam.copy( 0, nLastDelim );
2529 if (aPureFileName !=
"*")
2536static bool implCheckWildcard(std::u16string_view rName,
SbiRTLData const& rRTLData)
2542 bMatch = rRTLData.
moWildCard->Matches(rName);
2548static bool isRootDir( std::u16string_view aDirURLStr )
2554 sal_Int32
nCount = aDirURLObj.getSegmentCount();
2564 else if( nCount == 1 )
2566 OUString aSeg1 = aDirURLObj.getName( 0,
true,
2568 if( aSeg1[1] ==
':' )
2583 const sal_uInt32 nParCount = rPar.
Count();
2594 const uno::Reference< ucb::XSimpleFileAccess3 >& xSFI = getFileAccess();
2597 if ( nParCount >= 2 )
2601 OUString aFileURLStr = implSetupWildcard(aFileParam, rRTLData);
2604 bool bExists =
false;
2605 try { bExists = xSFI->exists( aFileURLStr ); }
2606 catch(
const Exception & ) {}
2608 OUString aNameOnlyStr;
2621 OUString aDirURLStr;
2622 bool bFolder = xSFI->isFolder( aFileURLStr );
2626 aDirURLStr = aFileURLStr;
2634 if ( nParCount > 2 )
2645 rRTLData.
aDirSeq = xSFI->getFolderContents(aDirURLStr, bIncludeFolders);
2649 if( bIncludeFolders )
2651 bool bRoot = isRootDir( aDirURLStr );
2663 catch(
const Exception & )
2669 if (rRTLData.
aDirSeq.hasElements())
2700 if( bCompatibility )
2704 bool bFolder = xSFI->isFolder( aFile );
2716 bool bFolder = xSFI->isFolder( aFile );
2729 bool bMatch = implCheckWildcard(aPath, rRTLData);
2743 if ( nParCount >= 2 )
2747 OUString aDirURL = implSetupWildcard(aFileParam, rRTLData);
2750 if ( nParCount > 2 )
2762 rRTLData.
pDir = std::make_unique<Directory>(aDirURL);
2763 FileBase::RC nRet = rRTLData.
pDir->open();
2764 if( nRet != FileBase::E_None )
2766 rRTLData.
pDir.reset();
2773 if( bIncludeFolders )
2775 bool bRoot = isRootDir( aDirURL );
2808 DirectoryItem aItem;
2809 FileBase::RC nRet = rRTLData.
pDir->getNextItem(aItem);
2810 if( nRet != FileBase::E_None )
2812 rRTLData.
pDir.reset();
2818 FileStatus aFileStatus( osl_FileStatus_Mask_Type | osl_FileStatus_Mask_FileName );
2819 nRet = aItem.getFileStatus( aFileStatus );
2820 if( nRet != FileBase::E_None )
2822 SAL_WARN(
"basic",
"getFileStatus failed");
2829 FileStatus::Type aType = aFileStatus.getFileType();
2830 bool bFolder = isFolder( aType );
2837 aPath = aFileStatus.getFileName();
2840 bool bMatch = implCheckWildcard(aPath, rRTLData);
2856 if (rPar.
Count() == 2)
2858 sal_Int16 nFlags = 0;
2867 FileBase::getSystemPathFromFileURL( aPathURL, aPath );
2868 DWORD nRealFlags = GetFileAttributesW (o3tl::toW(aPath.getStr()));
2869 if (nRealFlags != 0xffffffff)
2871 if (nRealFlags == FILE_ATTRIBUTE_NORMAL)
2875 nFlags =
static_cast<sal_Int16
>(nRealFlags);
2889 const uno::Reference< ucb::XSimpleFileAccess3 >& xSFI = getFileAccess();
2895 bool bExists =
false;
2896 try { bExists = xSFI->exists( aPath ); }
2897 catch(
const Exception & ) {}
2903 bool bReadOnly = xSFI->isReadOnly( aPath );
2904 bool bHidden = xSFI->isHidden( aPath );
2905 bool bDirectory = xSFI->isFolder( aPath );
2919 catch(
const Exception & )
2927 DirectoryItem aItem;
2929 FileStatus aFileStatus( osl_FileStatus_Mask_Attributes | osl_FileStatus_Mask_Type );
2930 (void)aItem.getFileStatus( aFileStatus );
2931 sal_uInt64
nAttributes = aFileStatus.getAttributes();
2934 FileStatus::Type aType = aFileStatus.getFileType();
2935 bool bDirectory = isFolder( aType );
2956 if (rPar.
Count() != 2)
2967 const uno::Reference< ucb::XSimpleFileAccess3 >& xSFI = getFileAccess();
2972 util::DateTime aUnoDT = xSFI->getDateTimeModified( aPath );
2974 aDate =
Date( aUnoDT );
2976 catch(
const Exception & )
2984 bool bSuccess =
false;
2987 DirectoryItem aItem;
2988 if (DirectoryItem::get(
getFullPath( aPath ), aItem ) != FileBase::E_None)
2991 FileStatus aFileStatus( osl_FileStatus_Mask_ModifyTime );
2992 if (aItem.getFileStatus( aFileStatus ) != FileBase::E_None)
2995 TimeValue aTimeVal = aFileStatus.getModifyTime();
2997 if (!osl_getDateTimeFromTimeValue( &aTimeVal, &aDT ))
3001 aTime =
tools::Time( aDT.Hours, aDT.Minutes, aDT.Seconds, aDT.NanoSeconds );
3002 aDate =
Date( aDT.Day, aDT.Month, aDT.Year );
3017 if (aDate.IsEmpty())
3019 aRes =
"0000-00-00 00:00:00";
3023 double fSerial =
static_cast<double>(
GetDayDiff( aDate ));
3026 nSeconds += aTime.GetMin() * 60;
3027 nSeconds += aTime.GetSec();
3028 double nDays =
static_cast<double>(nSeconds) / (24.0*3600.0);
3033 std::shared_ptr<SvNumberFormatter> pFormatter;
3046 pFormatter->GetOutputString( fSerial, nIndex, aRes, &pCol );
3056 if (rPar.
Count() != 2)
3075 beof = pSvStrm->
eof();
3083 beof = pSvStrm->
eof();
3096 if (rPar.
Count() != 3)
3112 nRet =
static_cast<sal_Int16
>(pSbStrm->
GetMode());
3124 if (rPar.
Count() != 2)
3142 nPos = nBlockLen ? (pSvStrm->
Tell() / nBlockLen) : 0;
3145 else if ( pSbStrm->
IsText() )
3153 else if ( pSbStrm->
IsSeq() )
3155 nPos = ( pSvStrm->
Tell()+1 ) / 128;
3161 rPar.
Get(0)->
PutLong(
static_cast<sal_Int32
>(nPos));
3168 if (rPar.
Count() != 2)
3182 sal_uInt64
const nLen = pSvStrm->
TellEnd();
3183 rPar.
Get(0)->
PutLong(
static_cast<sal_Int32
>(nLen));
3191 int nArgs =
static_cast<int>(rPar.
Count());
3192 if ( nArgs < 2 || nArgs > 3 )
3213 rPar.
Get(0)->
PutLong(
static_cast<sal_Int32
>(nPos));
3228 pStrm->
Seek(
static_cast<sal_uInt64
>(nPos) );
3235 const sal_uInt32 nArgCount = rPar.
Count();
3236 if ( nArgCount < 2 || nArgCount > 3 )
3243 if( nArgCount == 2 )
3256static bool IsMissing(
SbxArray& rPar,
const sal_uInt32 i)
3258 const sal_uInt32 nArgCount = rPar.
Count();
3266static sal_Int16 GetOptionalIntegerParamOrDefault(
SbxArray& rPar,
const sal_uInt32 i,
3267 const sal_Int16 defaultValue)
3269 return IsMissing(rPar, i) ? defaultValue : rPar.
Get(i)->
GetInteger();
3272static OUString GetOptionalOUStringParamOrDefault(
SbxArray& rPar,
const sal_uInt32 i,
3273 const OUString& defaultValue)
3275 return IsMissing(rPar, i) ? defaultValue : rPar.
Get(i)->
GetOUString();
3278static void lcl_FormatNumberPercent(
SbxArray& rPar,
bool isPercent)
3280 const sal_uInt32 nArgCount = rPar.
Count();
3281 if (nArgCount < 2 || nArgCount > 6)
3288 sal_Int16 nNumDigitsAfterDecimal = -1;
3289 if (nArgCount > 2 && !rPar.
Get(2)->
IsEmpty())
3292 if (nNumDigitsAfterDecimal < -1)
3296 else if (nNumDigitsAfterDecimal > 255)
3297 nNumDigitsAfterDecimal %= 256;
3299 if (nNumDigitsAfterDecimal == -1)
3303 if (nArgCount > 3 && !rPar.
Get(3)->
IsEmpty())
3307 case ooo::vba::VbTriState::vbFalse:
3308 bIncludeLeadingDigit =
false;
3310 case ooo::vba::VbTriState::vbTrue:
3311 bIncludeLeadingDigit =
true;
3313 case ooo::vba::VbTriState::vbUseDefault:
3321 bool bUseParensForNegativeNumbers =
false;
3322 if (nArgCount > 4 && !rPar.
Get(4)->
IsEmpty())
3326 case ooo::vba::VbTriState::vbFalse:
3327 case ooo::vba::VbTriState::vbUseDefault:
3330 case ooo::vba::VbTriState::vbTrue:
3331 bUseParensForNegativeNumbers =
true;
3338 bool bGroupDigits =
false;
3339 if (nArgCount > 5 && !rPar.
Get(5)->
IsEmpty())
3343 case ooo::vba::VbTriState::vbFalse:
3344 case ooo::vba::VbTriState::vbUseDefault:
3347 case ooo::vba::VbTriState::vbTrue:
3348 bGroupDigits =
true;
3358 const bool bNegative = fVal < 0;
3362 static const sal_Unicode decSep = localeData.getNumDecimalSep().toChar();
3363 OUStringBuffer aResult;
3364 rtl::math::doubleToUStringBuffer(aResult,
3365 fVal, rtl_math_StringFormat_F, nNumDigitsAfterDecimal, decSep,
3366 bGroupDigits ? localeData.getDigitGrouping().getConstArray() :
nullptr,
3367 localeData.getNumThousandSep().toChar());
3369 if (!bIncludeLeadingDigit && aResult.getLength() > 1)
3370 aResult.stripStart(
'0');
3372 if (nNumDigitsAfterDecimal > 0)
3374 const sal_Int32 nSepPos = aResult.indexOf(decSep);
3384 if (bUseParensForNegativeNumbers)
3385 aResult.insert(0,
'(').append(
')');
3387 aResult.insert(0,
'-');
3390 aResult.append(
'%');
3397 return lcl_FormatNumberPercent(rPar,
false);
3403 return lcl_FormatNumberPercent(rPar,
true);
3410struct RandomNumberGenerator
3414 RandomNumberGenerator()
3418 std::random_device rd;
3426 catch (std::runtime_error& e)
3428 SAL_WARN(
"basic",
"Using std::random_device failed: " << e.what());
3434RandomNumberGenerator& theRandomNumberGenerator()
3436 static RandomNumberGenerator theGenerator;
3437 return theGenerator;
3444 if (rPar.
Count() > 2)
3448 if (rPar.
Count() == 2)
3451 theRandomNumberGenerator().global_rng.seed(nSeed);
3458 if (rPar.
Count() > 2)
3464 std::uniform_real_distribution<double> dist(0.0, 1.0);
3465 double const tmp(dist(theRandomNumberGenerator().global_rng));
3482 const sal_uInt32 nArgCount = rPar.
Count();
3483 if ( nArgCount < 2 || nArgCount > 5 )
3490 oslProcessOption nOptions = osl_Process_SEARCHPATH | osl_Process_DETACHED;
3494 if( nArgCount >= 4 )
3499 aCmdLine +=
" " + tmp;
3502 else if( aCmdLine.isEmpty() )
3507 sal_Int32 nLen = aCmdLine.getLength();
3511 std::vector<OUString> aTokenVector;
3520 if ( c !=
' ' && c !=
'\t' )
3526 if( c ==
'\"' || c ==
'\'' )
3528 sal_Int32 iFoundPos = aCmdLine.indexOf( c, i + 1 );
3532 aToken = aCmdLine.copy( i);
3537 aToken = aCmdLine.copy( i + 1, (iFoundPos - i - 1) );
3543 sal_Int32 iFoundSpacePos = aCmdLine.indexOf(
' ', i );
3544 sal_Int32 iFoundTabPos = aCmdLine.indexOf(
'\t', i );
3545 sal_Int32 iFoundPos = iFoundSpacePos >= 0 ? iFoundTabPos >= 0 ? std::min( iFoundSpacePos, iFoundTabPos ) : iFoundSpacePos : -1;
3549 aToken = aCmdLine.copy( i );
3554 aToken = aCmdLine.copy( i, (iFoundPos - i) );
3560 aTokenVector.push_back( aToken );
3564 sal_Int16 nWinStyle = 0;
3565 if( nArgCount >= 3 )
3571 nOptions |= osl_Process_MINIMIZED;
3574 nOptions |= osl_Process_MAXIMIZED;
3577 nOptions |= osl_Process_FULLSCREEN;
3582 if( nArgCount >= 5 )
3588 nOptions |= osl_Process_WAIT;
3593 std::vector<OUString>::const_iterator iter = aTokenVector.begin();
3598 sal_uInt16 nParamCount = sal::static_int_cast< sal_uInt16 >(aTokenVector.size() - 1 );
3599 std::unique_ptr<rtl_uString*[]> pParamList;
3602 pParamList.reset(
new rtl_uString*[nParamCount]);
3603 for(
int iVector = 0; iter != aTokenVector.end(); ++iVector, ++iter)
3605 const OUString& rParamStr = *iter;
3606 pParamList[iVector] =
nullptr;
3607 rtl_uString_assign(&(pParamList[iVector]), rParamStr.pData);
3612 bool bSucc = osl_executeProcess(
3613 aOUStrProgURL.pData,
3620 &pApp ) == osl_Process_E_None;
3625 osl_freeProcessHandle( pApp );
3628 for(
int j = 0; j < nParamCount; ++j)
3630 rtl_uString_release(pParamList[j]);
3646 if (rPar.
Count() != 2)
3660 static const char* pTypeNames[] =
3702 size_t nPos =
static_cast<size_t>(
eType) & 0x0FFF;
3703 const size_t nTypeNameCount = std::size( pTypeNames );
3704 if ( nPos >= nTypeNameCount )
3706 nPos = nTypeNameCount - 1;
3708 return OUString::createFromAscii(pTypeNames[nPos]);
3711static OUString getObjectTypeName(
SbxVariable* pVar )
3713 OUString sRet(
"Object" );
3735 uno::Reference< XServiceInfo > xServInfo( aObj, uno::UNO_QUERY );
3736 if ( xServInfo.is() )
3740 if ( sServices.hasElements() )
3742 sRet = sServices[ 0 ];
3747 uno::Reference< bridge::oleautomation::XAutomationObject > xAutoMation( aObj, uno::UNO_QUERY );
3748 if ( xAutoMation.is() )
3750 uno::Reference< script::XInvocation > xInv( aObj, uno::UNO_QUERY );
3755 xInv->getValue(
"$GetTypeName" ) >>= sRet;
3757 catch(
const Exception& )
3763 sal_Int32 nDot = sRet.lastIndexOf(
'.' );
3764 if ( nDot != -1 && nDot < sRet.getLength() )
3766 sRet = sRet.copy( nDot + 1 );
3776 if (rPar.
Count() != 2)
3788 aRetStr = getObjectTypeName(rPar.
Get(1));
3804 if (rPar.
Count() != 2)
3817 int nArgs =
static_cast<int>(rPar.
Count());
3841 int nArgs =
static_cast<int>(rPar.
Count());
3859 int nArgs =
static_cast<int>(rPar.
Count());
3875 int nArgs =
static_cast<int>(rPar.
Count());
3898 int nArgs =
static_cast<int>(rPar.
Count());
3916 int nArgs =
static_cast<int>(rPar.
Count());
3925 ErrCode nDdeErr = pDDE->
Poke( nChannel, rItem, rData );
3935 if (rPar.
Count() != 1)
3956 const sal_uInt32 nParCount = rPar.
Count();
3957 if ( nParCount != 3 && nParCount != 2 )
3965 sal_Int32 nLower, nUpper;
3966 short nDim = (nParCount == 3) ?
static_cast<short>(rPar.
Get(2)->
GetInteger()) : 1;
3967 if (!pArr->
GetDim(nDim, nLower, nUpper))
3974 const sal_uInt32 nParCount = rPar.
Count();
3975 if ( nParCount != 3 && nParCount != 2 )
3983 sal_Int32 nLower, nUpper;
3984 short nDim = (nParCount == 3) ?
static_cast<short>(rPar.
Get(2)->
GetInteger()) : 1;
3985 if (!pArr->
GetDim(nDim, nLower, nUpper))
3992 if (rPar.
Count() != 4)
4007 if( bCompatibility )
4009 nRGB = (nBlue << 16) | (nGreen << 8) | nRed;
4013 nRGB = (nRed << 16) | (nGreen << 8) | nBlue;
4020 static const sal_Int32 pRGB[] =
4040 if (rPar.
Count() != 2)
4046 if( nCol < 0 || nCol > 15 )
4050 sal_Int32 nRGB = pRGB[ nCol ];
4054static std::vector<sal_uInt8> byteArray2Vec(
SbxArray* pArr)
4056 std::vector<sal_uInt8>
result;
4060 result.reserve(nCount + 1);
4061 for (sal_uInt32 i = 0;
i <
nCount;
i++)
4069static std::vector<sal_uInt8> getByteArray(
SbxValue& val)
4074 if (
auto pArr =
dynamic_cast<SbxArray*
>(pObj))
4075 return byteArray2Vec(pArr);
4079 *pStringValue = val;
4084 *pValue = *pStringValue;
4085 return byteArray2Vec(
dynamic_cast<SbxArray*
>(pValue->GetObject()));
4091 const sal_uInt32 nArgCount = rPar.
Count() - 1;
4092 if( nArgCount < 2 || nArgCount > 3 )
4097 sal_Int32 nConversion = rPar.
Get(2)->
GetLong();
4105 if (nConversion == ooo::vba::VbStrConv::vbUnicode)
4109 auto inArray = getByteArray(*rPar.
Get(1));
4110 std::string_view s(
reinterpret_cast<char*
>(inArray.data()), inArray.size() /
sizeof(
char));
4112 OUString aOUStr = OStringToOUString(s, encoding);
4117 if (nConversion == ooo::vba::VbStrConv::vbFromUnicode)
4121 auto inArray = getByteArray(*rPar.
Get(1));
4123 inArray.push_back(
'\0');
4124 std::u16string_view s(
reinterpret_cast<sal_Unicode*
>(inArray.data()),
4129 const sal_Int32 ub = lb + aOStr.getLength() - 1;
4133 for (sal_Int32 i = 0;
i < aOStr.getLength(); ++
i)
4137 pArray->
Put(pNew, i);
4149 std::vector<TransliterationFlags> aTranslitSet;
4152 if ((nConversion & conv) != conv)
4155 aTranslitSet.push_back(flag);
4156 nConversion &= ~conv;
4162 if (!
check(ooo::vba::VbStrConv::vbProperCase, TransliterationFlags::TITLE_CASE))
4163 if (!
check(ooo::vba::VbStrConv::vbUpperCase, TransliterationFlags::LOWERCASE_UPPERCASE))
4164 check(ooo::vba::VbStrConv::vbLowerCase, TransliterationFlags::UPPERCASE_LOWERCASE);
4166 if (!
check(ooo::vba::VbStrConv::vbWide, TransliterationFlags::HALFWIDTH_FULLWIDTH))
4167 check(ooo::vba::VbStrConv::vbNarrow, TransliterationFlags::FULLWIDTH_HALFWIDTH);
4169 if (!
check(ooo::vba::VbStrConv::vbKatakana, TransliterationFlags::HIRAGANA_KATAKANA))
4170 check(ooo::vba::VbStrConv::vbHiragana, TransliterationFlags::KATAKANA_HIRAGANA);
4176 if (!
aStr.isEmpty() && !aTranslitSet.empty())
4180 for (
auto transliterationFlag : aTranslitSet)
4182 if (transliterationFlag == TransliterationFlags::TITLE_CASE)
4188 aStr = aCharClass.titlecase(aCharClass.lowercase(aStr));
4193 aStr = aWrapper.transliterate(aStr, nLanguage, 0,
aStr.getLength(),
nullptr);
4204 if (rPar.
Count() != 1)
4213 if (rPar.
Count() != 2)
4240 if (rPar.
Count() != 2)
4252 pFormModule->Unload();
4266 if (rPar.
Count() != 2)
4276 ReadDIB(aBmp, *pStream,
true);
4289 if (rPar.
Count() != 3)
4298 const Graphic& aGraphic = pPicture->GetGraphic();
4300 aSerializer.writeGraphic(aGraphic);
4306 const sal_uInt32 nArgCount = rPar.
Count();
4307 if( nArgCount < 2 || nArgCount > 6 )
4313 if (IsMissing(rPar, 1))
4347 switch (nDialogType)
4350 eType = VclMessageType::Error;
4353 eType = VclMessageType::Question;
4356 eType = VclMessageType::Warning;
4359 eType = VclMessageType::Info;
4364 eType, VclButtonsType::NONE, aMsg,
GetpApp()));
4370 xBox->add_button(
GetStandardText(StandardButtonType::OK), BasicResponse::Ok);
4373 xBox->add_button(
GetStandardText(StandardButtonType::OK), BasicResponse::Ok);
4374 xBox->add_button(
GetStandardText(StandardButtonType::Cancel), BasicResponse::Cancel);
4376 if (nType & 256 || nType & 512)
4377 xBox->set_default_response(BasicResponse::Cancel);
4379 xBox->set_default_response(BasicResponse::Ok);
4383 xBox->add_button(
GetStandardText(StandardButtonType::Abort), BasicResponse::Abort);
4384 xBox->add_button(
GetStandardText(StandardButtonType::Retry), BasicResponse::Retry);
4385 xBox->add_button(
GetStandardText(StandardButtonType::Ignore), BasicResponse::Ignore);
4388 xBox->set_default_response(BasicResponse::Retry);
4389 else if (nType & 512)
4390 xBox->set_default_response(BasicResponse::Ignore);
4392 xBox->set_default_response(BasicResponse::Cancel);
4396 xBox->add_button(
GetStandardText(StandardButtonType::Yes), BasicResponse::Yes);
4397 xBox->add_button(
GetStandardText(StandardButtonType::No), BasicResponse::No);
4398 xBox->add_button(
GetStandardText(StandardButtonType::Cancel), BasicResponse::Cancel);
4400 if (nType & 256 || nType & 512)
4401 xBox->set_default_response(BasicResponse::Cancel);
4403 xBox->set_default_response(BasicResponse::Yes);
4407 xBox->add_button(
GetStandardText(StandardButtonType::Yes), BasicResponse::Yes);
4408 xBox->add_button(
GetStandardText(StandardButtonType::No), BasicResponse::No);
4410 if (nType & 256 || nType & 512)
4411 xBox->set_default_response(BasicResponse::No);
4413 xBox->set_default_response(BasicResponse::Yes);
4417 xBox->add_button(
GetStandardText(StandardButtonType::Retry), BasicResponse::Retry);
4418 xBox->add_button(
GetStandardText(StandardButtonType::Cancel), BasicResponse::Cancel);
4420 if (nType & 256 || nType & 512)
4421 xBox->set_default_response(BasicResponse::Cancel);
4423 xBox->set_default_response(BasicResponse::Retry);
4428 xBox->set_title(aTitle);
4429 sal_Int16 nRet = xBox->run();
4436 if (rPar.
Count() == 3)
4443 const uno::Reference< ucb::XSimpleFileAccess3 >& xSFI = getFileAccess();
4449 xSFI->setReadOnly( aStr, bReadOnly );
4451 xSFI->setHidden( aStr, bHidden );
4453 catch(
const Exception & )
4477 const sal_uInt32 nArgCount = rPar.
Count();
4478 if( nArgCount < 2 || nArgCount > 3 )
4489 while(
p->GetParent() )
4494 StreamMode::WRITE | StreamMode::TRUNC );
4497 if( aStrm.GetError() != ERRCODE_NONE )
4507 if (rPar.
Count() == 2)
4510 bool bExists =
false;
4514 const uno::Reference< ucb::XSimpleFileAccess3 >& xSFI = getFileAccess();
4519 bExists = xSFI->exists( aStr );
4521 catch(
const Exception & )
4529 DirectoryItem aItem;
4530 FileBase::RC nRet = DirectoryItem::get(
getFullPath( aStr ), aItem );
4531 bExists = (nRet == FileBase::E_None);
4543 if (rPar.
Count() != 5)
4551 sal_Int32 nInterval = rPar.
Get(4)->
GetLong();
4553 if( nStart < 0 || nStop <= nStart || nInterval < 1 )
4565 OUString aBeforeStart = OUString::number( nStart - 1 );
4566 OUString aAfterStop = OUString::number( nStop + 1 );
4567 sal_Int32 nLen1 = aBeforeStart.getLength();
4568 sal_Int32 nLen2 = aAfterStop.getLength();
4569 sal_Int32 nLen = nLen1 >= nLen2 ? nLen1:nLen2;
4571 OUStringBuffer aRetStr( nLen * 2 + 1);
4572 OUString aLowerValue;
4573 OUString aUpperValue;
4574 if( nNumber < nStart )
4576 aUpperValue = aBeforeStart;
4578 else if( nNumber > nStop )
4580 aLowerValue = aAfterStop;
4584 sal_Int32 nLowerValue = nNumber;
4585 sal_Int32 nUpperValue = nLowerValue;
4588 nLowerValue = ((( nNumber - nStart ) / nInterval ) * nInterval ) + nStart;
4589 nUpperValue = nLowerValue + nInterval - 1;
4591 aLowerValue = OUString::number( nLowerValue );
4592 aUpperValue = OUString::number( nUpperValue );
4595 nLen1 = aLowerValue.getLength();
4596 nLen2 = aUpperValue.getLength();
4601 for ( sal_Int32 i= nLen - nLen1;
i > 0; --
i )
4603 aRetStr.append(
" ");
4606 aRetStr.append( aLowerValue +
":");
4610 for ( sal_Int32 i= nLen - nLen2;
i > 0; --
i )
4612 aRetStr.append(
" ");
4615 aRetStr.append( aUpperValue );
4623 Date aRefDate(1899'12'30);
4624 sal_Int32 nDays =
static_cast<sal_Int32
>(aDate);
4626 sal_Int16 nRet = aRefDate.
GetYear();
4641#if HAVE_FEATURE_SCRIPTING
4654 if ( 0 <= nYear && nYear < 100 &&
4655#
if HAVE_FEATURE_SCRIPTING
4666 sal_Int32 nAddMonths = 0;
4667 sal_Int32 nAddDays = 0;
4669 if (nMonth < 1 || 12 < nMonth)
4671 sal_Int16 nM = ((nMonth < 1) ? (12 + (nMonth % 12)) : (nMonth % 12));
4672 nAddMonths = nMonth - nM;
4680 nAddDays = nDay - 1;
4685 nAddDays = nDay - 31;
4689 Date aCurDate( nDay, nMonth, nYear );
4698#if HAVE_FEATURE_SCRIPTING
4705#if HAVE_FEATURE_SCRIPTING
4751 sal_Int16 nHour, sal_Int16 nMinute, sal_Int16 nSecond,
4763 double nFrac = dDate - floor( dDate );
4765 sal_Int32 nSeconds =
static_cast<sal_Int32
>(nFrac + 0.5);
4766 sal_Int16 nTemp =
static_cast<sal_Int16
>(nSeconds % 3600);
4767 sal_Int16 nMin = nTemp / 60;
css::uno::Sequence< sal_Int8 > Buffer
const LanguageTag & GetLanguageTag() const
static OUString GetDisplayName()
static const AllSettings & GetSettings()
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
static weld::Window * GetDefDialogParent()
OUString uppercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
OUString lowercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
void AddDays(sal_Int32 nAddDays)
sal_Int16 GetYear() const
void SetMonth(sal_uInt16 nNewMonth)
void AddMonths(sal_Int32 nAddMonths)
void SetDay(sal_uInt16 nNewDay)
sal_uInt16 GetMonth() const
LanguageType getLanguageType(bool bResolveSystem=true) const
static sal_uInt16 getNumDigits()
static bool isNumLeadingZero()
css::uno::Any getUnoAny()
ErrCode Poke(size_t nChannel, const OUString &rItem, const OUString &rData)
ErrCode Initiate(const OUString &rService, const OUString &rTopic, size_t &rnHandle)
ErrCode Request(size_t nChannel, const OUString &rItem, OUString &rResult)
ErrCode Execute(size_t nChannel, const OUString &rCommand)
ErrCode Terminate(size_t nChannel)
sal_uInt32 GetStdDateTimeIdx() const
SbiRTLData & GetRTLData()
SbiIoSystem * GetIoSystem()
bool IsCompatibility() const
static std::shared_ptr< SvNumberFormatter > PrepareNumberFormatter(sal_uInt32 &rnStdDateIdx, sal_uInt32 &rnStdTimeIdx, sal_uInt32 &rnStdDateTimeIdx, LanguageType const *peFormatterLangType=nullptr, DateOrder const *peFormatterDateOrder=nullptr)
sal_uInt32 GetStdTimeIdx() const
std::shared_ptr< SvNumberFormatter > const & GetNumberFormatter()
sal_uInt32 GetStdDateIdx() const
SbiDdeControl * GetDdeControl()
SbiStream * GetStream(short nChannel) const
std::unique_ptr< osl::Directory > pDir
std::optional< WildCard > moWildCard
OUString sFullNameToBeChecked
css::uno::Sequence< OUString > aDirSeq
static bool isVBAEnabled()
bool IsImageFlag(SbiImageFlags n) const
static bool IsMissing(SbxVariable *, sal_uInt16)
SbxVariable * GetExternalCaller()
SbiStreamFlags GetMode() const
short GetBlockLen() const
sal_uInt64 GetLine() const
void SetExpandOnWriteTo(sal_uInt64 n)
SbxVariable * Get(sal_uInt32)
static void SetError(ErrCode)
void SetFlags(SbxFlagBits n)
static ErrCode const & GetError()
SbxFlagBits GetFlags() const
static SbxObjectRef CreateObject(const OUString &)
static SbxBaseRef Load(SvStream &)
virtual SbxDataType GetType() const
void ResetFlag(SbxFlagBits n)
bool GetDim(sal_Int32, sal_Int32 &, sal_Int32 &) const
void unoAddDim(sal_Int32, sal_Int32)
void Put(SbxVariable *, const sal_Int32 *)
static css::uno::Reference< ooo::vba::XErrObject > const & getUnoErrObject()
OUString GetOUString() const
bool PutString(const OUString &)
SbxBase * GetObject() const
SbxDataType GetFullType() const
virtual bool IsFixed() const override
sal_uInt8 GetByte() const
bool PutInteger(sal_Int16)
bool PutObject(SbxBase *)
sal_Int32 GetLong() const
sal_Int16 GetInteger() const
bool IsNumericRTL() const
void Format(OUString &, const OUString *=nullptr) const
virtual void Broadcast(SfxHintId nHintId) override
void SetParameters(SbxArray *p)
virtual SbxDataType GetType() const override
static ErrCode GetErrBasic()
static ErrCode GetSfxFromVBError(sal_uInt16 nError)
static const OUString & GetErrorText()
static void Error(ErrCode, const OUString &rMsg={})
static OUString GetErrorMsg()
static void MakeErrorText(ErrCode, std::u16string_view aMsg)
const SbxObjectRef & getRTL() const
virtual sal_uInt64 TellEnd()
SvStream & ReadChar(char &rChar)
sal_uInt64 Seek(sal_uInt64 nPos)
sal_uInt64 SeekRel(sal_Int64 nPos)
static bool deleteDirRecursively(const OUString &rDirURL)
sal_Int32 compareString(const OUString &rStr1, const OUString &rStr2) const
void loadModuleIfNeeded(LanguageType nLang)
static std::unique_ptr< SvStream > CreateStream(const OUString &rFileName, StreamMode eOpenMode, css::uno::Reference< css::awt::XWindow > xParentWin=nullptr)
sal_Int16 implGetHour(double dDate)
void SbxDateFromUNOTime(SbxValue *, const css::util::Time &)
void SbxDateFromUNODate(SbxValue *, const css::util::Date &)
void SbxDateFromUNODateTime(SbxValue *, const css::util::DateTime &)
sal_Int16 implGetSecond(double dDate)
css::util::DateTime SbxDateToUNODateTime(const SbxValue *)
css::util::Date SbxDateToUNODate(const SbxValue *)
css::util::Time SbxDateToUNOTime(const SbxValue *)
sal_Int16 implGetDateDay(double aDate)
sal_Int16 implGetDateMonth(double aDate)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
bool implDateTimeSerial(sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, sal_Int16 nHour, sal_Int16 nMinute, sal_Int16 nSecond, double &rdRet)
bool implDateSerial(sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, bool bUseTwoDigitYear, SbDateCorrection eCorr, double &rdRet)
sal_Int16 implGetDateYear(double aDate)
static sal_Int32 GetDayDiff(const Date &rDate)
sal_Int16 implGetMinute(double dDate)
double implTimeSerial(sal_Int16 nHours, sal_Int16 nMinutes, sal_Int16 nSeconds)
void registerCurrentDirectory(const uno::Reference< frame::XModel > &rxModel, const OUString &rPath)
bool isdigitAsciiString(std::string_view rString)
OString stripEnd(const OString &rIn, char c)
OStringBuffer & padToLength(OStringBuffer &rBuffer, sal_Int32 nLength, char cFill='\0')
OString stripStart(const OString &rIn, char c)
Reference< XComponentContext > getProcessComponentContext()
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC css::uno::Sequence< css::uno::Reference< css::xml::dom::XElement > > check(dp_misc::DescriptionInfoset const &infoset)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
void SbRtl_Rnd(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_CurDir(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Sgn(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_StrComp(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_FormatPercent(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_ChDrive(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Date(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Day(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_CreateObject(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_String(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_CDateToUnoDateTime(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_GetAttr(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Mid(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_IsArray(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_DDEPoke(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Int(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_IsMissing(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Left(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_LTrim(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_IsEmpty(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Time(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_FileAttr(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_DateSerial(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Sqr(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Lof(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_TimeSerial(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_MsgBox(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_RGB(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Kill(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Sin(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Hex(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_TimeValue(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_SavePicture(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Oct(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Dir(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Space(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_ChrW(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_DumpAllObjects(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_ChDir(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Beep(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_InStr(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_IsNumeric(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Shell(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_FormatNumber(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Tan(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Seek(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_FileCopy(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_SendKeys(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Partition(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_DDETerminateAll(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_FreeFile(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_IsNull(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Hour(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_DDEExecute(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_CDateFromUnoDate(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_MkDir(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_CDateToUnoDate(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_CDateFromUnoDateTime(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_LoadPicture(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Abs(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_EOF(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_FileExists(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Atn(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_IsObject(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_TypeName(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_FileDateTime(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_UBound(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Len(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Fix(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Second(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_LCase(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Val(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Minute(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Loc(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Reset(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_IsDate(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_FuncCaller(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_RTrim(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Cos(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Str(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Load(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_InStrRev(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Exp(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Month(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_FileLen(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_IsError(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_CDateFromUnoTime(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_RTL(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_CDateFromIso(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Year(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Randomize(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_CDateToIso(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Now(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_LBound(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_UCase(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_DDEInitiate(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_SetAttr(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Tab(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_CDateToUnoTime(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Right(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Format(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_DateValue(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Error(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Unload(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_StrConv(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_RmDir(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Replace(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_QBColor(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Timer(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_DDETerminate(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_DDERequest(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_VarType(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Chr(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Asc(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void SbRtl_Log(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
OUString getFullPath(const OUString &aRelPath)
void implStepRenameUCB(const OUString &aSource, const OUString &aDest)
void implStepRenameOSL(const OUString &aSource, const OUString &aDest)
void checkArithmeticOverflow(double d)
BASIC_DLLPUBLIC OUString getBasicTypeName(SbxDataType eType)
#define ERRCODE_BASIC_TOO_MANY_FILES
#define ERRCODE_BASIC_ACCESS_ERROR
#define ERRCODE_BASIC_BAD_PARAMETER
#define ERRCODE_BASIC_NO_DEVICE
#define ERRCODE_BASIC_MUST_HAVE_DIMS
#define ERRCODE_BASIC_FILE_EXISTS
#define ERRCODE_BASIC_OUT_OF_RANGE
#define ERRCODE_BASIC_MATH_OVERFLOW
#define ERRCODE_BASIC_FILE_NOT_FOUND
#define ERRCODE_BASIC_CANNOT_LOAD
#define ERRCODE_BASIC_PATH_NOT_FOUND
#define ERRCODE_BASIC_CONVERSION
#define ERRCODE_BASIC_NO_MEMORY
#define ERRCODE_BASIC_BAD_ARGUMENT
#define ERRCODE_BASIC_INTERNAL_ERROR
#define ERRCODE_BASIC_NOT_IMPLEMENTED
#define ERRCODE_BASIC_NOT_OPTIONAL
#define ERRCODE_BASIC_IO_ERROR
#define ERRCODE_BASIC_BAD_CHANNEL
void unoToSbxValue(SbxVariable *pVar, const Any &aValue)
SbxVariable * getDefaultProp(SbxVariable *pRef)
Any sbxToUnoValue(const SbxValue *pVar)
uno::Reference< frame::XModel > getDocumentModel(StarBASIC *pb)
OUString VCL_DLLPUBLIC GetStandardText(StandardButtonType eButton)
std::unique_ptr<::utl::TransliterationWrapper > pTransliterationWrapper
TransliterationFlags transliterateFlags
VCL_DLLPUBLIC Application * GetpApp()
UNOTOOLS_DLLPUBLIC rtl_TextEncoding utl_getWinTextEncodingFromLangStr(const OUString &sLanguage, bool bOEM=false)