Kaydet (Commit) 7ac77e31 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Create skeleton accessors for cell text script types.

Change-Id: I5408cdd87f06423a6bb287c855237878859da880
üst 188042ad
......@@ -387,6 +387,9 @@ public:
sal_uInt16 GetTextWidth(SCROW nRow) const;
void SetTextWidth(SCROW nRow, sal_uInt16 nWidth);
sal_uInt8 GetScriptType( SCROW nRow ) const;
void SetScriptType( SCROW nRow, sal_uInt8 nType );
private:
ScBaseCell* CloneCell(SCSIZE nIndex, sal_uInt16 nFlags, ScDocument& rDestDoc, const ScAddress& rDestPos) const;
......
......@@ -1177,7 +1177,8 @@ public:
bool HasStringWeakCharacters( const rtl::OUString& rString );
SC_DLLPUBLIC sal_uInt8 GetStringScriptType( const rtl::OUString& rString );
SC_DLLPUBLIC sal_uInt8 GetCellScriptType( ScBaseCell* pCell, sal_uLong nNumberFormat );
SC_DLLPUBLIC sal_uInt8 GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell = NULL );
SC_DLLPUBLIC sal_uInt8 GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell );
sal_uInt8 GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
bool HasDetectiveOperations() const;
void AddDetectiveOperation( const ScDetOpData& rData );
......
......@@ -793,6 +793,9 @@ public:
sal_uLong AddCondFormat( ScConditionalFormat* pNew );
sal_uInt8 GetScriptType( SCCOL nCol, SCROW nRow ) const;
void SetScriptType( SCCOL nCol, SCROW nRow, sal_uInt8 nType );
private:
void FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
sal_uLong nFillCount, FillDir eFillDir, FillCmd eFillCmd,
......
......@@ -1396,6 +1396,20 @@ void ScColumn::SetTextWidth(SCROW nRow, unsigned short nWidth)
maTextWidths.set(nRow, nWidth);
}
sal_uInt8 ScColumn::GetScriptType( SCROW nRow ) const
{
if (!ValidRow(nRow))
return SC_SCRIPTTYPE_UNKNOWN;
return SC_SCRIPTTYPE_UNKNOWN;
}
void ScColumn::SetScriptType( SCROW nRow, sal_uInt8 nType )
{
if (!ValidRow(nRow))
return;
}
void ScColumn::FindDataAreaPos(SCROW& rRow, bool bDown) const
{
// check if we are in a data area
......
......@@ -5767,4 +5767,13 @@ void ScDocument::SetAutoNameCache( ScAutoNameCache* pCache )
delete pAutoNameCache;
pAutoNameCache = pCache;
}
sal_uInt8 ScDocument::GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab ) const
{
if (!ValidTab(nTab) || nTab >= static_cast<SCTAB>(maTabs.size()) || !maTabs[nTab])
return SC_SCRIPTTYPE_UNKNOWN;
return maTabs[nTab]->GetScriptType(nCol, nRow);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -2080,6 +2080,22 @@ sal_uLong ScTable::AddCondFormat( ScConditionalFormat* pNew )
return nMax + 1;
}
sal_uInt8 ScTable::GetScriptType( SCCOL nCol, SCROW nRow ) const
{
if (!ValidCol(nCol))
return SC_SCRIPTTYPE_UNKNOWN;
return aCol[nCol].GetScriptType(nRow);
}
void ScTable::SetScriptType( SCCOL nCol, SCROW nRow, sal_uInt8 nType )
{
if (!ValidCol(nCol))
return;
aCol[nCol].SetScriptType(nRow, nType);
}
void ScTable::DeleteConditionalFormat( sal_uLong nIndex )
{
mpCondFormatList->erase(nIndex);
......
......@@ -823,7 +823,7 @@ sal_uInt8 ScViewFunc::GetSelectionScriptType()
// no selection -> cursor
nScript = pDoc->GetScriptType( GetViewData()->GetCurX(),
GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
GetViewData()->GetCurY(), GetViewData()->GetTabNo(), NULL );
}
else
{
......
......@@ -71,7 +71,7 @@ sal_uInt16 ScViewUtil::GetEffLanguage( ScDocument* pDoc, const ScAddress& rPos )
{
// used for thesaurus
sal_uInt8 nScript = pDoc->GetScriptType( rPos.Col(), rPos.Row(), rPos.Tab() );
sal_uInt8 nScript = pDoc->GetScriptType( rPos.Col(), rPos.Row(), rPos.Tab(), NULL );
sal_uInt16 nWhich = ( nScript == SCRIPTTYPE_ASIAN ) ? ATTR_CJK_FONT_LANGUAGE :
( ( nScript == SCRIPTTYPE_COMPLEX ) ? ATTR_CTL_FONT_LANGUAGE : ATTR_FONT_LANGUAGE );
const SfxPoolItem* pItem = pDoc->GetAttr( rPos.Col(), rPos.Row(), rPos.Tab(), nWhich);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment