22 #include <com/sun/star/i18n/BreakIterator.hpp>
23 #include <com/sun/star/i18n/ScriptType.hpp>
26 #include <document.hxx>
42 if ( !pScriptTypeData )
44 if ( !pScriptTypeData->xBreakIter.is() )
48 return pScriptTypeData->xBreakIter;
53 if (!rString.isEmpty())
55 uno::Reference<i18n::XBreakIterator> xBreakIter = GetBreakIterator();
56 if ( xBreakIter.is() )
58 sal_Int32 nLen = rString.getLength();
63 sal_Int16
nType = xBreakIter->getScriptType( rString, nPos );
64 if ( nType == i18n::ScriptType::WEAK )
67 nPos = xBreakIter->endOfScript( rString, nPos, nType );
69 while ( nPos >= 0 && nPos < nLen );
79 if (!rString.isEmpty())
81 uno::Reference<i18n::XBreakIterator> xBreakIter = GetBreakIterator();
82 if ( xBreakIter.is() )
84 sal_Int32 nLen = rString.getLength();
89 sal_Int16
nType = xBreakIter->getScriptType( rString, nPos );
92 case i18n::ScriptType::LATIN:
93 nRet |= SvtScriptType::LATIN;
95 case i18n::ScriptType::ASIAN:
96 nRet |= SvtScriptType::ASIAN;
98 case i18n::ScriptType::COMPLEX:
99 nRet |= SvtScriptType::COMPLEX;
103 nPos = xBreakIter->endOfScript( rString, nPos, nType );
105 while ( nPos >= 0 && nPos < nLen );
115 if ( nStored != SvtScriptType::UNKNOWN )
127 SetScriptType(rPos, nRet);
138 if ( nStored != SvtScriptType::UNKNOWN )
143 const ScPatternAttr* pPattern = GetPattern( nCol, nRow, nTab );
144 if (!pPattern)
return SvtScriptType::NONE;
147 pCondSet = GetCondResult( nCol, nRow, nTab );
149 sal_uInt32 nFormat = pPattern->
GetNumberFormat( mxPoolHelper->GetFormTable(), pCondSet );
151 return GetCellScriptType(aPos, nFormat, pCell);
165 virtual void startColumn(
SCTAB nTab,
SCCOL nCol)
override
170 virtual void execute(
const ScAddress& rPos,
SCROW nLength,
bool bVal)
override
186 if (!TableExists(rPos.
Tab()))
187 return SvtScriptType::NONE;
189 return maTabs[rPos.
Tab()]->GetRangeScriptType(rBlockPos, rPos.
Col(), rPos.
Row(), rPos.
Row()+nLength-1);
195 for (
size_t i = 0,
n = rRanges.
size();
i <
n; ++
i)
202 aSet.
set(*
this, nTab, nCol, nRow1, nRow2,
true);
205 ScriptTypeAggregator aAction(*
this);
207 return aAction.getScriptType();
SC_DLLPUBLIC const css::uno::Reference< css::i18n::XBreakIterator > & GetBreakIterator()
SC_DLLPUBLIC bool InitColumnBlockPosition(sc::ColumnBlockPosition &rBlockPos, SCTAB nTab, SCCOL nCol)
Store position data for column array storage.
This is very similar to ScCellValue, except that it references the original value instead of copying ...
bool HasStringWeakCharacters(const OUString &rString)
SC_DLLPUBLIC SvtScriptType GetStringScriptType(const OUString &rString)
SvtScriptType GetRangeScriptType(sc::ColumnBlockPosition &rBlockPos, const ScAddress &rPos, SCROW nLength)
void set(const ScDocument &rDoc, SCTAB nTab, SCCOL nCol, SCROW nRow, bool bVal)
const SfxPoolItem & GetItem(sal_uInt16 nWhichP) const
Structure that stores segments of boolean flags per column, and perform custom action on those segmen...
sal_uInt32 GetNumberFormat(SvNumberFormatter *) const
SC_DLLPUBLIC SvtScriptType GetScriptType(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScRefCellValue *pCell=nullptr)
constexpr TypedWhichId< ScCondFormatItem > ATTR_CONDITIONAL(154)
Reference< XComponentContext > getProcessComponentContext()
SC_DLLPUBLIC SvtScriptType GetCellScriptType(const ScAddress &rPos, sal_uInt32 nNumberFormat, const ScRefCellValue *pCell=nullptr)
void executeAction(Action &ac) const