25 #include <com/sun/star/i18n/CalendarFieldIndex.hpp>
28 #include <osl/module.hxx>
39 #include <progress.hxx>
42 #include <compiler.hxx>
51 #include <tokenarray.hxx>
56 #include <globstr.hrc>
66 #include <string_view>
68 #include <osl/endian.h>
80 const char SYLK_LF[] =
"\x1b :";
85 return rStrm.
GetEndian() != SvStreamEndian::BIG;
87 return rStrm.
GetEndian() != SvStreamEndian::LITTLE;
106 : pDocSh( dynamic_cast<
ScDocShell* >(r.GetDocumentShell()) ), rDoc( r ),
107 nSizeLimit( 0 ), nMaxImportRow(!
utl::ConfigManager::IsFuzzing() ? rDoc.MaxRow() :
SCROWS32K),
108 cSep(
'\t' ), cStr(
'"' ),
109 bFormulas( false ), bIncludeFiltered( true ),
110 bAll( true ), bSingle( true ), bUndo( false ),
111 bOverflowRow( false ), bOverflowCol( false ), bOverflowCell( false ),
112 mbApi( true ), mbImportBroadcast(false), mbOverwriting( false ),
121 : pDocSh( dynamic_cast<
ScDocShell* >(r.GetDocumentShell()) ), rDoc( r ),
123 nSizeLimit( 0 ), nMaxImportRow(!
utl::ConfigManager::IsFuzzing() ? rDoc.MaxRow() :
SCROWS32K),
124 cSep(
'\t' ), cStr(
'"' ),
125 bFormulas( false ), bIncludeFiltered( true ),
126 bAll( false ), bSingle( true ), bUndo( pDocSh != nullptr ),
127 bOverflowRow( false ), bOverflowCol( false ), bOverflowCell( false ),
128 mbApi( true ), mbImportBroadcast(false), mbOverwriting( false ),
138 : pDocSh( dynamic_cast<
ScDocShell* >(r.GetDocumentShell()) ), rDoc( r ),
140 nSizeLimit( 0 ), nMaxImportRow(!
utl::ConfigManager::IsFuzzing() ? rDoc.MaxRow() :
SCROWS32K),
141 cSep(
'\t' ), cStr(
'"' ),
142 bFormulas( false ), bIncludeFiltered( true ),
143 bAll( false ), bSingle( false ), bUndo( pDocSh != nullptr ),
144 bOverflowRow( false ), bOverflowCol( false ), bOverflowCell( false ),
145 mbApi( true ), mbImportBroadcast(false), mbOverwriting( false ),
157 : pDocSh( dynamic_cast<
ScDocShell* >(r.GetDocumentShell()) ), rDoc( r ),
158 nSizeLimit( 0 ), nMaxImportRow(!
utl::ConfigManager::IsFuzzing() ? rDoc.MaxRow() :
SCROWS32K),
159 cSep(
'\t' ), cStr(
'"' ),
160 bFormulas( false ), bIncludeFiltered( true ),
161 bAll( false ), bSingle( true ), bUndo( pDocSh != nullptr ),
162 bOverflowRow( false ), bOverflowCol( false ), bOverflowCell( false ),
163 mbApi( true ), mbImportBroadcast(false), mbOverwriting( false ),
171 OUString aPos( rPos );
224 return nFormat == SotClipboardFormatId::STRING
225 || nFormat == SotClipboardFormatId::STRING_TSVC
226 || nFormat == SotClipboardFormatId::SYLK
227 || nFormat == SotClipboardFormatId::LINK
228 || nFormat == SotClipboardFormatId::HTML
229 || nFormat == SotClipboardFormatId::HTML_SIMPLE
230 || nFormat == SotClipboardFormatId::DIF;
243 VclMessageType::Info, VclButtonsType::Ok,
269 ScMarkData aDestMark(pRedoDoc->GetSheetLimits());
288 css::uno::Any & rValue )
296 rValue <<= css::uno::Sequence< sal_Int8 >(
309 case SotClipboardFormatId::STRING :
310 case SotClipboardFormatId::STRING_TSVC :
318 rtl_TextEncoding eEnc = osl_getThreadTextEncoding();
319 OString aTmp( rText.getStr(), rText.getLength(), eEnc );
320 SvMemoryStream aStrm( const_cast<char *>(aTmp.getStr()), aTmp.getLength() *
sizeof(char), StreamMode::READ );
321 aStrm.SetStreamCharSet( eEnc );
330 if ( nFmt != SotClipboardFormatId::STRING && nFmt != SotClipboardFormatId::STRING_TSVC )
332 SAL_WARN(
"sc.ui",
"ScImportExport::ExportString: Unicode not supported for other formats than SotClipboardFormatId::STRING[_TSV]");
333 rtl_TextEncoding eEnc = osl_getThreadTextEncoding();
336 rText = OStringToOUString( aTmp, eEnc );
348 rText = OUString( static_cast<const sal_Unicode*>(aStrm.
GetData()) );
359 OSL_ENSURE( eEnc != RTL_TEXTENCODING_UNICODE,
"ScImportExport::ExportByteString: Unicode not supported" );
360 if ( eEnc == RTL_TEXTENCODING_UNICODE )
361 eEnc = osl_getThreadTextEncoding();
375 rText =
static_cast<const char*
>(aStrm.
GetData());
385 if( nFmt == SotClipboardFormatId::STRING || nFmt == SotClipboardFormatId::STRING_TSVC )
390 if( nFmt == SotClipboardFormatId::SYLK )
395 if( nFmt == SotClipboardFormatId::DIF )
400 if( nFmt == SotClipboardFormatId::RTF || nFmt == SotClipboardFormatId::RICHTEXT )
402 if(
RTF2Doc( rStrm, rBaseURL ) )
405 if( nFmt == SotClipboardFormatId::LINK )
407 if ( nFmt == SotClipboardFormatId::HTML )
412 if ( nFmt == SotClipboardFormatId::HTML_SIMPLE )
416 if ( pHTML &&
HTML2Doc( *pHTML, rBaseURL ) )
425 if( nFmt == SotClipboardFormatId::STRING || nFmt == SotClipboardFormatId::STRING_TSVC )
430 if( nFmt == SotClipboardFormatId::SYLK )
435 if( nFmt == SotClipboardFormatId::DIF )
440 if( nFmt == SotClipboardFormatId::LINK && !
bAll )
452 OSL_ENSURE( !aDocName.isEmpty(),
"ClipBoard document has no name! :-/" );
453 if( !aDocName.isEmpty() )
482 if( nFmt == SotClipboardFormatId::HTML )
487 if( nFmt == SotClipboardFormatId::RTF || nFmt == SotClipboardFormatId::RICHTEXT )
499 if ( eEnc == RTL_TEXTENCODING_UNICODE )
501 if ( !lcl_IsEndianSwap( rStrm ) )
506 const sal_Unicode*
const pStop = p + rString.getLength();
547 sal_Int32 nWidth = 0;
548 while(nIdx < rStr.getLength() && nWidth < nMaxWidth)
550 sal_uInt32
nCode = rStr.iterateCodePoints(&nIdx);
558 if (nIdx < rStr.getLength())
560 sal_Int32 nTmpIdx = nIdx;
561 sal_uInt32
nCode = rStr.iterateCodePoints(&nTmpIdx);
580 rStrm.
SetEndian( SvStreamEndian::LITTLE );
612 return FIELDEND_QUOTE;
615 if (p[1] == cBlank && !rcDetectSep && p[2] && p[2] != cBlank)
616 rcDetectSep = cBlank;
617 while (p[1] == cBlank)
620 return FIELDEND_QUOTE;
621 return DONTKNOW_QUOTE;
648 if ((nQuotes % 2) == 0)
654 SAL_WARN(
"sc",
"lcl_isEscapedOrFieldEndQuote: really want a FIELDSTART_QUOTE?");
655 return FIELDSTART_QUOTE;
671 rField += OUString( p1, sal::static_int_cast<sal_Int32>( p2 - p1 ) );
676 SAL_WARN(
"sc",
"lcl_appendLineData: data overflow");
695 if (eMode != DoubledQuoteMode::KEEP_ALL)
711 if (eMode == DoubledQuoteMode::ESCAPE)
725 case DoubledQuoteMode::KEEP_ALL :
728 case DoubledQuoteMode::ESCAPE :
733 if ( eMode == DoubledQuoteMode::ESCAPE )
741 if (!
lcl_appendLineData( rString, p0, ((eMode != DoubledQuoteMode::KEEP_ALL && (*p || *(p-1) == cStr)) ? p-1 : p)))
742 rbOverflowCell =
true;
753 if (eVersion >= SylkVersion::OOO32)
754 rString = rString.replaceAll(
";;",
";");
756 rString = rString.replaceAll(
"\"\"",
"\"");
758 rString = rString.replaceAll(SYLK_LF,
"\n");
771 if (eVersion >= SylkVersion::OOO32)
791 else if (*(p+1) ==
';')
798 rString += OUString(pStartQuote + 1, sal::static_int_cast<sal_Int32>( pEndQuote - pStartQuote - 1 ) );
807 if (eVersion >= SylkVersion::OOO32)
820 rString += OUString( pStart, sal::static_int_cast<sal_Int32>( p - pStart));
833 bool bQuoted =
false;
859 while (*p && *p !=
';')
861 rString += OUString( pStart, sal::static_int_cast<sal_Int32>( p - pStart));
870 while( ( n = rString.indexOf( cStr, n ) ) != -1 )
872 rString = rString.replaceAt( n, 0, OUString(cStr) );
884 rString = OUStringChar(cQuote) + rString + OUStringChar(cQuote);
920 SCROW nRow = nStartRow;
921 rStrm.
Seek( nOldPos );
926 DoubledQuoteMode mode = aLine.indexOf(
"\t") >= 0 ? DoubledQuoteMode::ESCAPE : DoubledQuoteMode::KEEP_ALL;
929 SCCOL nCol = nStartCol;
935 while (*p && *p !=
cSep)
938 while (*p && *p ==
cStr)
941 while (*p && *p !=
cSep && *p !=
cStr)
953 if (nCol>nEndCol) nEndCol = nCol;
954 if (nRow>nEndRow) nEndRow = nRow;
956 if( bData && nCol <= nEndCol && nRow <= nEndRow )
998 const ::utl::TransliterationWrapper& rTransliteration,
CalendarWrapper& rCalendar,
999 const ::utl::TransliterationWrapper* pSecondTransliteration,
CalendarWrapper* pSecondCalendar )
1002 bool bMultiLine =
false;
1005 if ( rStr.isEmpty() )
1007 if ( !bSkipEmptyCells )
1009 if ( bUseDocImport )
1012 rDoc.
SetString( nCol, nRow, nTab, rStr );
1030 if ( bUseDocImport )
1061 if ( bUseDocImport )
1064 rDoc.
SetValue( nCol, nRow, nTab, fVal );
1071 const sal_uInt16 nMaxNumberParts = 7;
1072 sal_Int32 nLen = rStr.getLength();
1073 sal_Int32 nStart[nMaxNumberParts];
1074 sal_Int32 nEnd[nMaxNumberParts];
1076 sal_uInt16 nDP, nMP, nYP;
1077 switch ( nColFormat )
1079 case SC_COL_YMD: nDP = 2; nMP = 1; nYP = 0;
break;
1080 case SC_COL_MDY: nDP = 1; nMP = 0; nYP = 2;
break;
1082 default: nDP = 0; nMP = 1; nYP = 2;
break;
1085 sal_uInt16 nFound = 0;
1086 bool bInNum =
false;
1087 for ( sal_Int32
nPos=0;
nPos<nLen && (bInNum ||
1088 nFound<nMaxNumberParts);
nPos++ )
1090 if (bInNum && nFound == 3 && nColFormat ==
SC_COL_YMD &&
1091 nPos <= nStart[nFound]+2 && rStr[
nPos] ==
'T')
1093 else if ((((!bInNum && nFound==nMP) || (bInNum && nFound==nMP+1))
1100 nStart[nFound] =
nPos;
1103 nEnd[nFound-1] =
nPos;
1113 sal_Int32 nDateStart = nStart[0];
1114 sal_Int32 nDateLen = nEnd[0] + 1 - nDateStart;
1116 if ( nDateLen >= 5 && nDateLen <= 8 &&
1123 bool bLongYear = ( nDateLen >= 7 );
1124 bool bShortFirst = ( nDateLen == 5 || nDateLen == 7 );
1126 sal_uInt16 nFieldStart = nDateStart;
1129 sal_uInt16 nFieldEnd = nFieldStart + 1;
1130 if ( bLongYear &&
nPos == nYP )
1132 if ( bShortFirst &&
nPos == 0 )
1135 nStart[
nPos] = nFieldStart;
1136 nEnd[
nPos] = nFieldEnd;
1137 nFieldStart = nFieldEnd + 1;
1146 bool bSecondCal =
false;
1147 sal_uInt16 nDay =
static_cast<sal_uInt16
>(rStr.copy( nStart[nDP], nEnd[nDP]+1-nStart[nDP] ).toInt32());
1148 sal_uInt16 nYear =
static_cast<sal_uInt16
>(rStr.copy( nStart[nYP], nEnd[nYP]+1-nStart[nYP] ).toInt32());
1149 OUString aMStr = rStr.copy( nStart[nMP], nEnd[nMP]+1-nStart[nMP] );
1150 sal_Int16 nMonth =
static_cast<sal_Int16
>(aMStr.toInt32());
1153 static constexpr OUStringLiteral aSepShortened =
u"SEP";
1154 uno::Sequence< i18n::CalendarItem2 > xMonths;
1155 sal_Int32
i, nMonthCount;
1158 nMonthCount = xMonths.getLength();
1159 for (i=0; i<nMonthCount && !nMonth; i++)
1161 if ( rTransliteration.isEqual( aMStr, xMonths[i].FullName ) ||
1162 rTransliteration.isEqual( aMStr, xMonths[i].AbbrevName ) )
1163 nMonth = sal::static_int_cast<sal_Int16>( i+1 );
1164 else if ( i == 8 && rTransliteration.isEqual(
"SEPT",
1165 xMonths[i].AbbrevName ) &&
1166 rTransliteration.isEqual( aMStr, aSepShortened ) )
1169 nMonth = sal::static_int_cast<sal_Int16>( i+1 );
1173 if ( !nMonth && pSecondCalendar && pSecondTransliteration )
1176 nMonthCount = xMonths.getLength();
1177 for (i=0; i<nMonthCount && !nMonth; i++)
1179 if ( pSecondTransliteration->isEqual( aMStr, xMonths[i].FullName ) ||
1180 pSecondTransliteration->isEqual( aMStr, xMonths[i].AbbrevName ) )
1182 nMonth = sal::static_int_cast<sal_Int16>( i+1 );
1185 else if ( i == 8 && pSecondTransliteration->isEqual(
1186 aMStr, aSepShortened ) )
1189 nMonth = sal::static_int_cast<sal_Int16>( i+1 );
1200 CalendarWrapper* pCalendar = (bSecondCal ? pSecondCalendar : &rCalendar);
1202 if ( nDay && nMonth && nDay<=31 && nMonth<=nNumMonths )
1205 pCalendar->
setValue( i18n::CalendarFieldIndex::DAY_OF_MONTH, nDay );
1206 pCalendar->
setValue( i18n::CalendarFieldIndex::MONTH, nMonth );
1207 pCalendar->
setValue( i18n::CalendarFieldIndex::YEAR, nYear );
1208 sal_Int16 nHour, nMinute, nSecond;
1211 nHour = nMinute = nSecond = 0;
1213 nHour =
static_cast<sal_Int16
>(rStr.copy( nStart[3], nEnd[3]+1-nStart[3]).toInt32());
1215 nMinute =
static_cast<sal_Int16
>(rStr.copy( nStart[4], nEnd[4]+1-nStart[4]).toInt32());
1217 nSecond =
static_cast<sal_Int16
>(rStr.copy( nStart[5], nEnd[5]+1-nStart[5]).toInt32());
1223 OUString aT = OUStringChar(cDec) + rStr.subView( nStart[6], nEnd[6]+1-nStart[6]);
1224 rtl_math_ConversionStatus eStatus;
1225 double fV = rtl::math::stringToDouble( aT, cDec, 0, &eStatus );
1226 if (eStatus == rtl_math_ConversionStatus_Ok)
1227 fFrac = fV / 86400.0;
1229 pCalendar->
setValue( i18n::CalendarFieldIndex::HOUR, nHour );
1230 pCalendar->
setValue( i18n::CalendarFieldIndex::MINUTE, nMinute );
1231 pCalendar->
setValue( i18n::CalendarFieldIndex::SECOND, nSecond );
1232 pCalendar->
setValue( i18n::CalendarFieldIndex::MILLISECOND, 0 );
1253 if ( bUseDocImport )
1266 if( rStr.indexOf(
'\n' ) == -1 )
1274 if ( bUseDocImport )
1277 rDoc.
SetString( nCol, nRow, nTab, rStr, &aParam );
1284 if ( bUseDocImport )
1292 static OUString
lcl_GetFixed(
const OUString& rLine, sal_Int32 nStart, sal_Int32 nNext,
1293 bool& rbIsQuoted,
bool& rbOverflowCell )
1295 sal_Int32 nLen = rLine.getLength();
1298 if ( nNext <= nStart )
1303 sal_Int32 nSpace = nNext;
1304 while ( nSpace > nStart && pStr[nSpace-1] ==
' ' )
1307 rbIsQuoted = (pStr[nStart] ==
'"' && pStr[nSpace-1] ==
'"');
1312 return rLine.copy(nStart+1, std::max< sal_Int32 >(0, nSpace-nStart-2));
1315 SAL_WARN(
"sc",
"lcl_GetFixed: line doesn't fit into data");
1316 rbOverflowCell =
true;
1324 return rLine.copy(nStart, nSpace-nStart);
1327 SAL_WARN(
"sc",
"lcl_GetFixed: line doesn't fit into data");
1328 rbOverflowCell =
true;
1339 sal_uInt64
const nOldPos = rStrm.
Tell();
1342 ScResId( STR_LOAD_DOC ), nRemaining,
true ));
1355 sal_uInt16 nInfoCount =
pExtOptions->GetInfoCount();
1356 const sal_Int32* pColStart =
pExtOptions->GetColStart();
1362 bool bDetectNumFormat =
pExtOptions->IsDetectSpecialNumber();
1363 bool bSkipEmptyCells =
pExtOptions->IsSkipEmptyCells();
1372 std::unique_ptr< ::utl::TransliterationWrapper > pEnglishTransliteration;
1373 std::unique_ptr< CalendarWrapper > pEnglishCalendar;
1376 pEnglishTransliteration.reset(new ::utl::TransliterationWrapper (
1380 pEnglishCalendar->loadDefaultCalendar(
1387 SCROW nRow = nStartRow;
1390 while(--nSkipLines>0)
1399 bool bDetermineRange =
bUndo;
1404 bool bRangeIsDetermined = bDetermineRange;
1416 if ( rStrm.
eof() && aLine.isEmpty() )
1419 assert(pSeps == aSeps.getStr());
1429 sal_Int32 nLineLen = aLine.getLength();
1430 SCCOL nCol = nStartCol;
1431 bool bMultiLine =
false;
1434 sal_Int32 nStartIdx = 0;
1439 for ( i=0; i<nInfoCount && nCol <=
rDoc.
MaxCol()+1; i++ )
1446 else if (!bDetermineRange)
1448 sal_Int32 nNextIdx = nStartIdx;
1449 if ( i + 1 < nInfoCount )
1452 nNextIdx = nLineLen;
1454 bool bIsQuoted =
false;
1456 if (bIsQuoted && bQuotedAsText)
1461 &aNumFormatter, bDetectNumFormat, bSkipEmptyCells, aTransliteration, aCalendar,
1462 pEnglishTransliteration.get(), pEnglishCalendar.get());
1464 nStartIdx = nNextIdx;
1472 SCCOL nSourceCol = 0;
1473 sal_uInt16 nInfoStart = 0;
1481 bool bIsQuoted =
false;
1486 for ( i=nInfoStart; i<nInfoCount; i++ )
1488 if ( pColStart[i] == nSourceCol + 1 )
1490 nFmt = pColFormat[i];
1499 else if (!bDetermineRange)
1501 if (bIsQuoted && bQuotedAsText)
1506 &aNumFormatter, bDetectNumFormat, bSkipEmptyCells, aTransliteration,
1507 aCalendar, pEnglishTransliteration.get(), pEnglishCalendar.get());
1518 if (!bDetermineRange)
1520 if (bMultiLine && !bRangeIsDetermined &&
pDocSh)
1522 xProgress->SetStateOnPercent( rStrm.
Tell() - nOldPos );
1527 if (nRow > nStartRow)
1529 if (nEndCol > nStartCol)
1530 nEndCol = ::std::min( static_cast<SCCOL>(nEndCol - 1),
rDoc.
MaxCol());
1532 if (bDetermineRange)
1537 if ( !
mbApi && nStartCol != nEndCol &&
1547 rStrm.
Seek( nOriginalStreamPos );
1556 bDetermineRange = !bDetermineRange;
1557 }
while (!bDetermineRange);
1562 if (bRangeIsDetermined)
1583 if (rStr.indexOf( cNull) >= 0)
1585 rStr = rStr.replaceAll( std::u16string_view( &cNull, 1),
"");
1591 bool& rbOverflowCell,
bool bRemoveSpace )
1602 while (*pb == cBlank)
1611 p1 = p =
lcl_ScanString( p, rField, pSeps, cStr, DoubledQuoteMode::ESCAPE, rbOverflowCell );
1621 while ( ptrim_f > p1 && ( *(ptrim_f - 1) == cBlank ) )
1625 rbOverflowCell =
true;
1639 while ( *ptrim_i == cBlank )
1641 while ( ptrim_f > ptrim_i && ( *(ptrim_f - 1) == cBlank ) )
1645 rbOverflowCell =
true;
1665 bool hasLineBreaksOrSeps(
const OUString& rStr,
sal_Unicode cSep )
1668 for (sal_Int32 i = 0, n = rStr.getLength();
i <
n; ++
i, ++p)
1710 std::vector< sc::ColumnBlockPosition > blockPos( nEndCol - nStartCol + 1 );
1711 for(
SCCOL i = nStartCol;
i <= nEndCol; ++
i )
1713 for (nRow = nStartRow; nRow <= nEndRow; nRow++)
1717 for (nCol = nStartCol; nCol <= nEndCol; nCol++)
1731 if( aCellStr.indexOf( cSep ) != -1 )
1738 const Color* pColor;
1741 bool bMultiLineText = ( aCellStr.indexOf(
'\n' ) != -1 );
1742 if( bMultiLineText )
1745 aCellStr = aCellStr.replaceAll(
"\n",
" " );
1762 const Color* pColor;
1771 const Color* pColor;
1774 bool bMultiLineText = ( aCellStr.indexOf(
'\n' ) != -1 );
1775 if( bMultiLineText )
1778 aCellStr = aCellStr.replaceAll(
"\n",
" " );
1792 if( nCol < nEndCol )
1809 bool bMyDoc =
false;
1822 ::std::vector< sal_uInt32 > aFormats;
1832 SCCOL nCol = nStartCol;
1833 SCROW nRow = nStartRow;
1834 SCCOL nRefCol = nCol;
1835 SCROW nRefRow = nRow;
1836 rStrm.
Seek( nOldPos );
1844 bool bInvalidCol =
false;
1845 bool bInvalidRow =
false;
1853 bool bInvalidRefCol =
false;
1854 bool bInvalidRefRow =
false;
1863 bInvalidCol =
false;
1864 bool bFail = o3tl::checked_add<SCCOL>(OUString(p).toInt32(), nStartCol - 1, nCol);
1865 if (bFail || nCol < 0 ||
rDoc.
MaxCol() < nCol)
1867 SAL_WARN(
"sc.ui",
"ScImportExport::Sylk2Doc - ;X invalid nCol=" << nCol);
1868 nCol = std::clamp<SCCOL>(nCol, 0,
rDoc.
MaxCol());
1875 bInvalidRow =
false;
1879 SAL_WARN(
"sc.ui",
"ScImportExport::Sylk2Doc - ;Y invalid nRow=" << nRow);
1887 bInvalidRefCol =
false;
1888 bool bFail = o3tl::checked_add<SCCOL>(OUString(p).toInt32(), nStartCol - 1, nRefCol);
1889 if (bFail || nRefCol < 0 ||
rDoc.
MaxCol() < nRefCol)
1891 SAL_WARN(
"sc.ui",
"ScImportExport::Sylk2Doc - ;C invalid nRefCol=" << nRefCol);
1892 nRefCol = std::clamp<SCCOL>(nRefCol, 0,
rDoc.
MaxCol());
1899 bInvalidRefRow =
false;
1903 SAL_WARN(
"sc.ui",
"ScImportExport::Sylk2Doc - ;R invalid nRefRow=" << nRefRow);
1912 ( nCol < nStartCol || nCol > nEndCol
1913 || nRow < nStartRow || nRow > nEndRow
1915 || bInvalidCol || bInvalidRow ) )
1919 if( nRow > nEndRow )
1921 if( nCol > nEndCol )
1935 while( *q && *q !=
';' )
1937 if ( (*q !=
';' || *(q+1) !=
'I') && !bInvalidCol && !bInvalidRow )
1947 double fVal = rtl_math_uStringToDouble( p,
1948 aLine.getStr() + aLine.getLength(),
1949 cDecSep, cGrpSep,
nullptr, nullptr );
1960 if ( nRefCol < nCol )
1962 if ( nRefRow < nRow )
1966 if( nRefRow > nEndRow )
1968 if( nRefCol > nEndCol )
1972 if( !bMyDoc || !bData )
1977 if (bInvalidCol || bInvalidRow || (ch ==
'M' && (bInvalidRefCol || bInvalidRefRow)))
1987 std::unique_ptr<ScTokenArray> xCode(aComp.
CompileString(aText));
2005 while( *p && *p !=
';' )
2011 else if( cTag ==
'F' )
2015 sal_Int32 nFormat = -1;
2024 bInvalidCol =
false;
2025 bool bFail = o3tl::checked_add<SCCOL>(OUString(p).toInt32(), nStartCol - 1, nCol);
2026 if (bFail || nCol < 0 ||
rDoc.
MaxCol() < nCol)
2028 SAL_WARN(
"sc.ui",
"ScImportExport::Sylk2Doc - ;X invalid nCol=" << nCol);
2029 nCol = std::clamp<SCCOL>(nCol, 0,
rDoc.
MaxCol());
2036 bInvalidRow =
false;
2040 SAL_WARN(
"sc.ui",
"ScImportExport::Sylk2Doc - ;Y invalid nRow=" << nRow);
2053 while( *p && *p !=
';' )
2055 OUString aNumber(p0, p - p0);
2056 nFormat = aNumber.toInt32();
2060 while( *p && *p !=
';' )
2067 if( nRow > nEndRow )
2069 if( nCol > nEndCol )
2072 if ( 0 <= nFormat && nFormat < static_cast<sal_Int32>(aFormats.size()) && !bInvalidCol && !bInvalidRow )
2074 sal_uInt32 nKey = aFormats[nFormat];
2079 else if( cTag ==
'P' )
2081 if ( bData && *p ==
';' && *(p+1) ==
'P' )
2083 OUString aCode( p+2 );
2086 sal_Int32 nCheckPos;
2096 aCode = aCode.replaceAll(
";;",
";");
2098 aCode = aCode.replaceAll(
"\x1b",
"");
2107 aFormats.push_back( nKey );
2110 else if( cTag ==
'I' && *p ==
'D' )
2112 aLine = aLine.copy(4);
2113 if (aLine ==
"CALCOOO32")
2114 eVersion = SylkVersion::OOO32;
2115 else if (aLine ==
"SCALC3")
2116 eVersion = SylkVersion::SCALC3;
2117 bMyDoc = (eVersion <= SylkVersion::OWN);
2119 else if( cTag ==
'E' )
2150 for (nRow = nStartRow; nRow <= nEndRow; nRow++)
2152 for (nCol = nStartCol; nCol <= nEndCol; nCol++)
2157 SCROW r = nRow - nStartRow + 1;
2158 SCCOL c = nCol - nStartCol + 1;
2174 aValStr = ::rtl::math::doubleToUString( nVal,
2175 rtl_math_StringFormat_Automatic,
2176 rtl_math_DecimalPlaces_Max,
'.',
true );
2179 + OUString::number( c )
2181 + OUString::number( r )
2191 aCellStr = aCellStr.replaceAll(
"\n", SYLK_LF);
2194 + OUString::number( c )
2196 + OUString::number( r )
2211 OUString aOUCellStr;
2213 aCellStr = aOUCellStr;
2221 aCellStr.startsWith(
"{") &&
2222 aCellStr.endsWith(
"}") )
2224 aCellStr = aCellStr.copy(1, aCellStr.getLength()-2);
2226 if ( aCellStr[0] ==
'=' )
2227 aCellStr = aCellStr.copy(1);
2239 + OUString::number( nR )
2241 + OUString::number( nC )
2250 + OUString::number( aPos.
Row() - nStartRow + 1 )
2252 + OUString::number( aPos.
Col() - nStartCol + 1 );
2260 if ( !aCellStr.isEmpty() )
2304 pImportDoc->InitUndo(
rDoc, nTab, nTab );
2311 pImportDoc->GetCellArea( nTab, nEndCol, nEndRow );
2324 pImportDoc->CopyToDocument(
aRange, nFlags,
false,
rDoc);
2336 pImp->Read( rStrm, rBaseURL );
2337 aRange = pImp->GetRange();
2344 pImp->WriteToDocument();
2355 pImp->Read( rStrm, rBaseURL );
2356 aRange = pImp->GetRange();
2374 bool bSpecialNumber =
pExtOptions->IsDetectSpecialNumber();
2375 pImp->WriteToDocument(
false, 1.0, &aNumFormatter, bSpecialNumber);
2379 pImp->WriteToDocument();
2386 #ifndef DISABLE_DYNLOADING
2403 #ifndef DISABLE_DYNLOADING
2404 OUString sFilterLib(
SVLIBRARY(
"scfilt"));
2405 static ::osl::Module aModule;
2406 bool bLoaded = aModule.is();
2408 bLoaded = aModule.loadRelative(&
thisModule, sFilterLib);
2410 bLoaded = aModule.load(sFilterLib);
2413 oslGenericFunction fn = aModule.getFunctionSymbol(
"ScFilterCreate" );
2415 return reinterpret_cast<FilterFn>(fn)();
2446 #ifdef OSL_BIGENDIAN
2462 } eRetryState = (bEmbeddedLineBreak && rcDetectSep == 0 ? RetryState::ALLOW : RetryState::FORBID);
2464 sal_uInt64 nStreamPos = (eRetryState == RetryState::ALLOW ? rStream.
Tell() : 0);
2466 Label_RetryWithNewSep:
2468 if (eRetryState == RetryState::RETRY)
2470 eRetryState = RetryState::RETRIED;
2471 rStream.
Seek( nStreamPos);
2477 if (bEmbeddedLineBreak)
2479 const sal_Unicode* pSeps = rFieldSeparators.getStr();
2482 bool bFieldStart =
true;
2484 sal_Int32 nLastOffset = 0;
2485 sal_Int32 nQuotes = 0;
2488 const sal_Unicode * p = aStr.getStr() + nLastOffset;
2493 if (*p == cFieldQuote)
2498 bFieldStart =
false;
2499 eQuoteState = FIELDSTART_QUOTE;
2504 else if (eQuoteState != FIELDEND_QUOTE)
2508 if (eRetryState == RetryState::ALLOW && rcDetectSep ==
' ')
2510 eRetryState = RetryState::RETRY;
2511 rFieldSeparators += OUString(
' ');
2512 goto Label_RetryWithNewSep;
2517 if (eQuoteState != DONTKNOW_QUOTE)
2521 else if (eQuoteState == FIELDEND_QUOTE)
2534 if (*p == cFieldQuote && bFieldStart)
2537 eQuoteState = FIELDSTART_QUOTE;
2538 bFieldStart =
false;
2540 else if (eQuoteState == FIELDEND_QUOTE)
2557 if (nQuotes % 2 == 0)
2564 nLastOffset = aStr.getLength();
2567 aStr +=
"\n" + aNext;
static const OUString & GetClipDocName()
static OUString GetAppName()
SC_DLLPUBLIC void Format(OStringBuffer &r, ScRefFlags nFlags, const ScDocument *pDocument=nullptr, const Details &rDetails=detailsOOOa1) const
static const sal_Unicode * lcl_ScanString(const sal_Unicode *p, OUString &rString, const sal_Unicode *pSeps, sal_Unicode cStr, DoubledQuoteMode eMode, bool &rbOverflowCell)
TOOLS_DLLPUBLIC OString convertLineEnd(const OString &rIn, LineEnd eLineEnd)
static void lcl_WriteSimpleString(SvStream &rStrm, const OUString &rString)
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
void SetExtOptions(const ScAsciiOptions &rOpt)
const sal_uInt8 SC_COL_STANDARD
Store parameters used in the ScDocument::SetString() method.
sal_Unicode GetTextSep() const
const sal_uInt8 SC_COL_TEXT
bool mbHandleApostrophe
When true, treat input with a leading apostrophe as an escape character for a numeric value content...
static void WriteUnicodeOrByteEndl(SvStream &rStrm)
bool isDigit(const OUString &rStr, sal_Int32 nPos) const
SvStream & WriteUInt16(sal_uInt16 nUInt16)
void setValue(sal_Int16 nFieldIndex, sal_Int16 nValue)
Sheet / outlining (grouping) information.
bool isNumeric(const OUString &rStr) const
OUString GetTitle(sal_uInt16 nMaxLen=0) const
#define LANGUAGE_ENGLISH_US
bool AdjustRowHeight(SCROW nStartRow, SCROW nEndRow, SCTAB nTab)
merge with docfunc
SvNumberFormatter * mpNumFormatter
Stores the pointer to the number formatter instance to be used during number format detection...
bool ExportString(OUString &, SotClipboardFormatId)
sal_Int16 getNumberOfMonthsInYear() const
std::unique_ptr< ContentProperties > pData
static weld::Window * GetActiveDialogParent()
bool ReadUniOrByteStringLine(OUString &rStr, rtl_TextEncoding eSrcCharSet, sal_Int32 nMaxCodepointsToRead=0xFFFE)
bool Doc2Text(SvStream &)
static bool lcl_appendLineData(OUString &rField, const sal_Unicode *p1, const sal_Unicode *p2)
Append characters of [p1,p2) to rField.
bool mbCheckLinkFormula
When true and the string results in a compiled formula, check the formula tokens for presence of func...
LineEnd GetLineDelimiter() const
static vcl::Window * GetDefDialogParent()
static bool IsFormatSupported(SotClipboardFormatId nFormat)
SC_DLLPUBLIC ScRangeName * GetRangeName(SCTAB nTab) const
sal_Int32 toInt32(OUString const &rStr)
SC_DLLPUBLIC bool InitColumnBlockPosition(sc::ColumnBlockPosition &rBlockPos, SCTAB nTab, SCCOL nCol)
Warning box for "Replace cell contents?".
std::unique_ptr< ScTokenArray > CompileString(const OUString &rFormula)
Tokenize formula expression string into an array of tokens.
static const sal_Unicode * lcl_ScanSylkFormula(const sal_Unicode *p, OUString &rString, SylkVersion eVersion)
void SetDocumentModified()
sal_uInt64 Seek(sal_uInt64 nPos)
static const sal_Unicode * lcl_ScanSylkString(const sal_Unicode *p, OUString &rString, SylkVersion eVersion)
SC_DLLPUBLIC void GetNumberFormat(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt32 &rFormat) const
SvStream & WriteOString(const OString &rStr)
bool Doc2HTML(SvStream &, const OUString &)
SC_DLLPUBLIC void SetValue(SCCOL nCol, SCROW nRow, SCTAB nTab, const double &rVal)
This is very similar to ScCellValue, except that it references the original value instead of copying ...
static bool lcl_PutString(ScDocumentImport &rDocImport, bool bUseDocImport, SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rStr, sal_uInt8 nColFormat, SvNumberFormatter *pFormatter, bool bDetectNumFormat, bool bSkipEmptyCells, const ::utl::TransliterationWrapper &rTransliteration, CalendarWrapper &rCalendar, const ::utl::TransliterationWrapper *pSecondTransliteration, CalendarWrapper *pSecondCalendar)
SC_DLLPUBLIC void ApplyAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, const SfxPoolItem &rAttr)
Accessor class to ScDocument.
std::unique_ptr< ScAsciiOptions > pExtOptions
bool ImportStream(SvStream &, const OUString &rBaseURL, SotClipboardFormatId)
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
bool ExportData(const OUString &rMimeType, css::uno::Any &rValue)
static QuoteType lcl_isFieldEndQuote(const sal_Unicode *p, const sal_Unicode *pSeps, sal_Unicode &rcDetectSep)
Determine if *p is a quote that ends a quoted field.
void setEditCell(const ScAddress &rPos, std::unique_ptr< EditTextObject > pEditText)
SC_DLLPUBLIC void SetTextCell(const ScAddress &rPos, const OUString &rStr)
Call this if you are not sure whether to put this as an edit text or a simple text.
virtual sal_uInt64 TellEnd() override
TextFormatPolicy meSetTextNumFormat
Determine when to set the 'Text' number format to the cell where the input string is being set...
SC_DLLPUBLIC ScDocumentPool * GetPool()
virtual SfxUndoManager * GetUndoManager() override
static QuoteType lcl_isEscapedOrFieldEndQuote(sal_Int32 nQuotes, const sal_Unicode *p, const sal_Unicode *pSeps, sal_Unicode cStr, sal_Unicode &rcDetectSep)
Determine if *p is a quote that is escaped by being doubled or ends a quoted field.
weld::Window * GetFrameWeld() const
static void lcl_UnescapeSylk(OUString &rString, SylkVersion eVersion)
static bool SC_DLLPUBLIC isMultiline(const OUString &rStr)
void EndPaste(bool bAutoRowHeight=true)
SC_DLLPUBLIC void CheckLinkFormulaNeedingCheck(const ScTokenArray &rCode)
Check token array and set link check if ocDde/ocWebservice is contained.
static void WriteUnicodeOrByteString(SvStream &rStrm, const OUString &rString, bool bZero=false)
ScClipParam & GetClipParam()
std::unique_ptr< ScDocument, o3tl::default_delete< ScDocument > > pUndoDoc
void StartReadingUnicodeText(rtl_TextEncoding eReadBomCharSet)
static bool isCJKIVSCharacter(sal_uInt32 nCode)
NewlineConversion meNewlineConversion
SC_DLLPUBLIC SCROW MaxRow() const
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
static sal_Unicode GetWeightedFieldSep(const OUString &rFieldSeps, bool bDecodeNumbers)
From the import field separators obtain the one most likely to be used for export, if multiple separators weighted comma, tab, semicolon, space and other.
static OUString lcl_GetFixed(const OUString &rLine, sal_Int32 nStart, sal_Int32 nNext, bool &rbIsQuoted, bool &rbOverflowCell)
ScImportStringStream(const OUString &rStr)
bool ReadLine(OString &rStr, sal_Int32 nMaxBytesToRead=0xFFFE)
SC_DLLPUBLIC OUString GetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScInterpreterContext *pContext=nullptr) const
LineEnd GetSystemLineEnd()
void CopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, InsertDeleteFlags nFlags, bool bMarked, ScDocument &rDestDoc, const ScMarkData *pMarks=nullptr, bool bColRowFlags=true)
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
ScFormulaCell * mpFormula
static void lcl_WriteString(SvStream &rStrm, OUString &rString, sal_Unicode cQuote, sal_Unicode cEsc)
constexpr sal_Int32 nArbitraryCellLengthLimit
bool Text2Doc(SvStream &)
OUString aNonConvertibleChars
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
sal_uInt64 remainingSize()
static bool isIVSSelector(sal_uInt32 nCode)
ScDrawLayer * MakeDrawLayer()
bool HTML2Doc(SvStream &, const OUString &rBaseURL)
double getLocalDateTime() const
SC_DLLPUBLIC double GetValue(const ScAddress &rPos) const
SC_DLLPUBLIC void InsertMatrixFormula(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMarkData &rMark, const OUString &rFormula, const ScTokenArray *p=nullptr, const formula::FormulaGrammar::Grammar=formula::FormulaGrammar::GRAM_DEFAULT)
SC_DLLPUBLIC bool SetEditText(const ScAddress &rPos, std::unique_ptr< EditTextObject > pEditText)
This method manages the lifecycle of the passed edit text object.
const char * GetMessageId() const
void SetMarkArea(const ScRange &rRange)
SC_DLLPUBLIC bool SetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const ScSetStringParam *pParam=nullptr)
#define SFX_TITLE_FULLNAME
SC_DLLPUBLIC ScRangeData * findByUpperName(const OUString &rName)
SC_DLLPUBLIC SCCOL MaxCol() const
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
virtual void AddUndoAction(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false)
void SetTextCurrentDefaults(const EditTextObject &rTextObject)
SetText and apply defaults already set.
SC_DLLPUBLIC void GetSymbol(OUString &rSymbol, const formula::FormulaGrammar::Grammar eGrammar=formula::FormulaGrammar::GRAM_DEFAULT) const
bool ExportByteString(OString &, rtl_TextEncoding, SotClipboardFormatId)
bool RowFiltered(SCROW nRow, SCTAB nTab, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
void SelectTable(SCTAB nTab, bool bNew)
std::unique_ptr< ScDocument, o3tl::default_delete< ScDocument > > ScDocumentUniquePtr
bool ValidCol(SCCOL nCol) const
Set Text number format only when the input string is considered a special number but we only want to ...
ScSheetLimits & GetSheetLimits() const
SC_DLLPUBLIC OUString Format(const ScDocument &rDocument, ScRefFlags nFlags=ScRefFlags::ZERO, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1, bool bFullAddressNotation=false) const
Returns string with formatted cell range from aStart to aEnd, according to provided address conventio...
SC_DLLPUBLIC void ApplyPattern(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScPatternAttr &rAttr)
std::enable_if< std::is_signed< T >::value, bool >::type checked_add(T a, T b, T &result)
std::unique_ptr< EditTextObject > CreateTextObject()
std::size_t WriteBytes(const void *pData, std::size_t nSize)
OUString ScResId(const char *pId)
constexpr TypedWhichId< SfxUInt32Item > ATTR_VALUE_FORMAT(146)
bool ShrinkToDataArea(SCTAB nTab, SCCOL &rStartCol, SCROW &rStartRow, SCCOL &rEndCol, SCROW &rEndRow) const
Shrink a range to only include data area.
static void lcl_DoubleEscapeChar(OUString &rString, sal_Unicode cStr)
bool IsBlockEmpty(SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool bIgnoreNotes=false) const
~ScImportExport() COVERITY_NOEXCEPT_FALSE
static SC_DLLPUBLIC LanguageType eLnge
sal_Unicode mcSeparatorConvertTo
SC_DLLPUBLIC bool HasValueData(SCCOL nCol, SCROW nRow, SCTAB nTab) const
bool ExportStream(SvStream &, const OUString &rBaseURL, SotClipboardFormatId)
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
bool HasType(Type nType) const
void setAutoInput(const ScAddress &rPos, const OUString &rStr, const ScSetStringParam *pStringParam=nullptr)
void BroadcastCells(const ScRange &rRange, SfxHintId nHint, bool bBroadcastSingleBroadcasters=true)
SC_DLLPUBLIC void EnsureTable(SCTAB nTab)
bool Doc2Sylk(SvStream &)
static void EmbeddedNullTreatment(OUString &rStr)
SvStreamEndian GetEndian() const
void SetNumberFormat(const ScAddress &rPos, sal_uInt32 nNumberFormat)
bool ValidRow(SCROW nRow) const
SC_DLLPUBLIC ScFormulaCell * SetFormulaCell(const ScAddress &rPos, ScFormulaCell *pCell)
Set formula cell, and transfer its ownership to the document.
bool mbDetectNumberFormat
When true, we try to detect special number format (dates etc) from the input string, when false, we only try to detect a basic decimal number format.
static ScTabViewShell * GetActiveViewShell()
static sal_Unicode ToUpperAlpha(sal_Unicode c)
bool Sylk2Doc(SvStream &)
ScImportExport(ScDocument &)
static SotClipboardFormatId GetFormatIdFromMimeType(const OUString &rMimeType)
SvStream & endl(SvStream &rStr)
void SetEndian(SvStreamEndian SvStreamEndian)
void setStringCell(const ScAddress &rPos, const OUString &rStr)
SvStream & WriteUChar(unsigned char nChar)
ScExportTextOptions mExportTextOptions
css::uno::Sequence< css::i18n::CalendarItem2 > getMonths() const
void SetStreamCharSet(rtl_TextEncoding eCharSet)
SC_DLLPUBLIC ScRefFlags Parse(const OUString &, const ScDocument &, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1, ScAddress::ExternalInfo *pExtInfo=nullptr, const css::uno::Sequence< css::sheet::ExternalLinkInfo > *pExternalLinks=nullptr, const OUString *pErrRef=nullptr)
const sal_uInt8 SC_COL_MDY
const sal_uInt8 SC_COL_ENGLISH
static const sal_Unicode * lcl_UnicodeStrChr(const sal_Unicode *pStr, sal_Unicode c)
rtl_TextEncoding GetStreamCharSet() const
static SC_DLLPUBLIC const CharClass * getCharClassPtr()
Reference< XComponentContext > getProcessComponentContext()
bool RTF2Doc(SvStream &, const OUString &rBaseURL)
double getLength(const B2DPolygon &rCandidate)
bool ImportString(const OUString &, SotClipboardFormatId)
SvStream & WriteChar(char nChar)
void loadDefaultCalendar(const css::lang::Locale &rLocale, bool bTimeZoneUTC=true)
const DateTime & getEpochStart() const
static const sal_Unicode * UnicodeStrChr(const sal_Unicode *pStr, sal_Unicode c)
strchr() functionality on unicode, as long as we need it for FormulaToken etc.
OUString ReadCsvLine(SvStream &rStream, bool bEmbeddedLineBreak, OUString &rFieldSeparators, sal_Unicode cFieldQuote, sal_Unicode &rcDetectSep)
Read a CSV (comma separated values) data line using ReadUniOrByteStringLine().
SfxObjectShell * GetDocumentShell() const
#define SAL_WARN(area, stream)
bool IsUndoEnabled() const
SC_DLLPUBLIC ScRefFlags Parse(const OUString &, const ScDocument &, const Details &rDetails=detailsOOOa1, ExternalInfo *pExtInfo=nullptr, const css::uno::Sequence< css::sheet::ExternalLinkInfo > *pExternalLinks=nullptr, sal_Int32 *pSheetEndPos=nullptr, const OUString *pErrRef=nullptr)
void setNumericCell(const ScAddress &rPos, double fVal)
const sal_uInt8 SC_COL_DMY
void SetFilterOptions(const OUString &rFilterOptions)
SC_DLLPUBLIC void GetLanguage(LanguageType &rLatin, LanguageType &rCjk, LanguageType &rCtl) const
SC_DLLPUBLIC void DeleteAreaTab(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCTAB nTab, InsertDeleteFlags nDelFlag)
bool ExtText2Doc(SvStream &)
static const sal_Unicode * ScanNextFieldFromString(const sal_Unicode *p, OUString &rField, sal_Unicode cStr, const sal_Unicode *pSeps, bool bMergeSeps, bool &rbIsQuoted, bool &rbOverflowCell, bool bRemoveSpace)
constexpr sal_Int32 nArbitraryLineLengthLimit
static void SetNoEndianSwap(SvStream &rStrm)
only if stream is only used in own (!) memory
const OUString & GetFieldSeps() const
ScFormatFilterPlugin *(* FilterFn)()
const sal_uInt8 SC_COL_SKIP
SC_DLLPUBLIC ScFieldEditEngine & GetEditEngine()
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
virtual short run() override
Opens dialog if IsDialogEnabled() returns true.
void loadModuleIfNeeded(LanguageType nLang)
static sal_Int32 CountVisualWidth(const OUString &rStr, sal_Int32 &nIdx, sal_Int32 nMaxWidth)
ScImportExport::CountVisualWidth Count the width of string visually ( in multiple of western characte...
bool isMultiRange() const
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
const sal_uInt8 SC_COL_YMD