rework to avoid coverity#1371205 Missing move assignment operator
Change-Id: I117fa0891e8cd1bf339bded93a7ee19d799caf9f
This commit is contained in:
@@ -867,42 +867,22 @@ namespace accessibility
|
|||||||
return pValues[a].Name < pValues[b].Name;
|
return pValues[a].Name < pValues[b].Name;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
OUString AccessibleEditableTextPara::GetFieldTypeNameAtIndex(sal_Int32 nIndex)
|
namespace
|
||||||
|
{
|
||||||
|
OUString GetFieldTypeNameFromField(EFieldInfo &ree)
|
||||||
{
|
{
|
||||||
OUString strFldType;
|
OUString strFldType;
|
||||||
SvxAccessibleTextAdapter& rCacheTF = GetTextForwarder();
|
|
||||||
//For field object info
|
|
||||||
sal_Int32 nParaIndex = GetParagraphIndex();
|
|
||||||
sal_Int32 nAllFieldLen = 0;
|
|
||||||
sal_Int32 nField = rCacheTF.GetFieldCount(nParaIndex), nFoundFieldIndex = -1;
|
|
||||||
EFieldInfo ree;
|
|
||||||
sal_Int32 reeBegin, reeEnd;
|
|
||||||
sal_Int32 nFieldType = -1;
|
sal_Int32 nFieldType = -1;
|
||||||
for(sal_Int32 j = 0; j < nField; j++)
|
if (ree.pFieldItem)
|
||||||
{
|
|
||||||
ree = rCacheTF.GetFieldInfo(nParaIndex, j);
|
|
||||||
reeBegin = ree.aPosition.nIndex + nAllFieldLen;
|
|
||||||
reeEnd = reeBegin + ree.aCurrentText.getLength();
|
|
||||||
nAllFieldLen += (ree.aCurrentText.getLength() - 1);
|
|
||||||
if( reeBegin > nIndex )
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if( nIndex >= reeBegin && nIndex < reeEnd )
|
|
||||||
{
|
|
||||||
nFoundFieldIndex = j;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (nFoundFieldIndex >= 0 && ree.pFieldItem)
|
|
||||||
{
|
{
|
||||||
// So we get a field, check its type now.
|
// So we get a field, check its type now.
|
||||||
nFieldType = ree.pFieldItem->GetField()->GetClassId() ;
|
nFieldType = ree.pFieldItem->GetField()->GetClassId() ;
|
||||||
}
|
}
|
||||||
switch(nFieldType)
|
switch (nFieldType)
|
||||||
{
|
{
|
||||||
case text::textfield::Type::DATE:
|
case text::textfield::Type::DATE:
|
||||||
{
|
{
|
||||||
const SvxDateField* pDateField = static_cast< const SvxDateField* >(ree.pFieldItem->GetField());
|
const SvxDateField* pDateField = static_cast< const SvxDateField* >(ree.pFieldItem->GetField());
|
||||||
if (pDateField)
|
if (pDateField)
|
||||||
@@ -912,23 +892,23 @@ namespace accessibility
|
|||||||
else if (pDateField->GetType() == SVXDATETYPE_VAR)
|
else if (pDateField->GetType() == SVXDATETYPE_VAR)
|
||||||
strFldType = "date (variable)";
|
strFldType = "date (variable)";
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
case text::textfield::Type::PAGE:
|
||||||
case text::textfield::Type::PAGE:
|
strFldType = "page-number";
|
||||||
strFldType = "page-number";
|
break;
|
||||||
break;
|
//support the sheet name & pages fields
|
||||||
//support the sheet name & pages fields
|
case text::textfield::Type::PAGES:
|
||||||
case text::textfield::Type::PAGES:
|
strFldType = "page-count";
|
||||||
strFldType = "page-count";
|
break;
|
||||||
break;
|
case text::textfield::Type::TABLE:
|
||||||
case text::textfield::Type::TABLE:
|
strFldType = "sheet-name";
|
||||||
strFldType = "sheet-name";
|
break;
|
||||||
break;
|
//End
|
||||||
//End
|
case text::textfield::Type::TIME:
|
||||||
case text::textfield::Type::TIME:
|
strFldType = "time";
|
||||||
strFldType = "time";
|
break;
|
||||||
break;
|
case text::textfield::Type::EXTENDED_TIME:
|
||||||
case text::textfield::Type::EXTENDED_TIME:
|
|
||||||
{
|
{
|
||||||
const SvxExtTimeField* pTimeField = static_cast< const SvxExtTimeField* >(ree.pFieldItem->GetField());
|
const SvxExtTimeField* pTimeField = static_cast< const SvxExtTimeField* >(ree.pFieldItem->GetField());
|
||||||
if (pTimeField)
|
if (pTimeField)
|
||||||
@@ -938,20 +918,48 @@ namespace accessibility
|
|||||||
else if (pTimeField->GetType() == SVXTIMETYPE_VAR)
|
else if (pTimeField->GetType() == SVXTIMETYPE_VAR)
|
||||||
strFldType = "time (variable)";
|
strFldType = "time (variable)";
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
case text::textfield::Type::AUTHOR:
|
||||||
case text::textfield::Type::AUTHOR:
|
strFldType = "author";
|
||||||
strFldType = "author";
|
break;
|
||||||
break;
|
case text::textfield::Type::EXTENDED_FILE:
|
||||||
case text::textfield::Type::EXTENDED_FILE:
|
case text::textfield::Type::DOCINFO_TITLE:
|
||||||
case text::textfield::Type::DOCINFO_TITLE:
|
strFldType = "file name";
|
||||||
strFldType = "file name";
|
break;
|
||||||
break;
|
default:
|
||||||
default:
|
break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return strFldType;
|
return strFldType;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace accessibility
|
||||||
|
{
|
||||||
|
OUString AccessibleEditableTextPara::GetFieldTypeNameAtIndex(sal_Int32 nIndex)
|
||||||
|
{
|
||||||
|
SvxAccessibleTextAdapter& rCacheTF = GetTextForwarder();
|
||||||
|
//For field object info
|
||||||
|
sal_Int32 nParaIndex = GetParagraphIndex();
|
||||||
|
sal_Int32 nAllFieldLen = 0;
|
||||||
|
sal_Int32 nField = rCacheTF.GetFieldCount(nParaIndex);
|
||||||
|
for (sal_Int32 j = 0; j < nField; ++j)
|
||||||
|
{
|
||||||
|
EFieldInfo ree = rCacheTF.GetFieldInfo(nParaIndex, j);
|
||||||
|
sal_Int32 reeBegin = ree.aPosition.nIndex + nAllFieldLen;
|
||||||
|
sal_Int32 reeEnd = reeBegin + ree.aCurrentText.getLength();
|
||||||
|
nAllFieldLen += (ree.aCurrentText.getLength() - 1);
|
||||||
|
if (reeBegin > nIndex)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (nIndex >= reeBegin && nIndex < reeEnd)
|
||||||
|
{
|
||||||
|
return GetFieldTypeNameFromField(ree);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return OUString();
|
||||||
|
}
|
||||||
|
|
||||||
uno::Reference< XAccessibleStateSet > SAL_CALL AccessibleEditableTextPara::getAccessibleStateSet() throw (uno::RuntimeException, std::exception)
|
uno::Reference< XAccessibleStateSet > SAL_CALL AccessibleEditableTextPara::getAccessibleStateSet() throw (uno::RuntimeException, std::exception)
|
||||||
{
|
{
|
||||||
@@ -1621,7 +1629,7 @@ namespace accessibility
|
|||||||
for (sal_Int32 j = 0; j < nField; ++j)
|
for (sal_Int32 j = 0; j < nField; ++j)
|
||||||
{
|
{
|
||||||
EFieldInfo ree = rCacheTF.GetFieldInfo(nParaIndex, j);
|
EFieldInfo ree = rCacheTF.GetFieldInfo(nParaIndex, j);
|
||||||
reeBegin = ree.aPosition.nIndex + nAllFieldLen;
|
reeBegin = ree.aPosition.nIndex + nAllFieldLen;
|
||||||
reeEnd = reeBegin + ree.aCurrentText.getLength();
|
reeEnd = reeBegin + ree.aCurrentText.getLength();
|
||||||
nAllFieldLen += (ree.aCurrentText.getLength() - 1);
|
nAllFieldLen += (ree.aCurrentText.getLength() - 1);
|
||||||
if( reeBegin > nIndex )
|
if( reeBegin > nIndex )
|
||||||
|
Reference in New Issue
Block a user