Kaydet (Commit) e7fe9094 authored tarafından Miklos Vajna's avatar Miklos Vajna

sw: prefix members of SwXMLTableCellContext_Impl

Change-Id: Ifb10b563e90c79469652af95133301f3909f8393
Reviewed-on: https://gerrit.libreoffice.org/54897Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst f50eb2d1
...@@ -391,30 +391,30 @@ void SwXMLTableRow_Impl::Dispose() ...@@ -391,30 +391,30 @@ void SwXMLTableRow_Impl::Dispose()
class SwXMLTableCellContext_Impl : public SvXMLImportContext class SwXMLTableCellContext_Impl : public SvXMLImportContext
{ {
OUString aStyleName; OUString m_aStyleName;
OUString sFormula; OUString m_sFormula;
OUString sSaveParaDefault; OUString m_sSaveParaDefault;
OUString mXmlId; OUString mXmlId;
OUString m_StringValue; OUString m_StringValue;
SvXMLImportContextRef xMyTable; SvXMLImportContextRef m_xMyTable;
double fValue; double m_fValue;
bool bHasValue; bool m_bHasValue;
bool m_bHasStringValue; bool m_bHasStringValue;
bool m_bValueTypeIsString; bool m_bValueTypeIsString;
bool bProtect; bool m_bProtect;
sal_uInt32 nRowSpan; sal_uInt32 m_nRowSpan;
sal_uInt32 nColSpan; sal_uInt32 m_nColSpan;
sal_uInt32 nColRepeat; sal_uInt32 m_nColRepeat;
bool bHasTextContent : 1; bool m_bHasTextContent : 1;
bool bHasTableContent : 1; bool m_bHasTableContent : 1;
SwXMLTableContext *GetTable() { return static_cast<SwXMLTableContext *>(xMyTable.get()); } SwXMLTableContext *GetTable() { return static_cast<SwXMLTableContext *>(m_xMyTable.get()); }
bool HasContent() const { return bHasTextContent || bHasTableContent; } bool HasContent() const { return m_bHasTextContent || m_bHasTableContent; }
inline void InsertContent_(); inline void InsertContent_();
inline void InsertContent(); inline void InsertContent();
inline void InsertContent( SwXMLTableContext *pTable ); inline void InsertContent( SwXMLTableContext *pTable );
...@@ -439,20 +439,20 @@ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl( ...@@ -439,20 +439,20 @@ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl(
const Reference< xml::sax::XAttributeList > & xAttrList, const Reference< xml::sax::XAttributeList > & xAttrList,
SwXMLTableContext *pTable ) : SwXMLTableContext *pTable ) :
SvXMLImportContext( rImport, nPrfx, rLName ), SvXMLImportContext( rImport, nPrfx, rLName ),
sFormula(), m_sFormula(),
xMyTable( pTable ), m_xMyTable( pTable ),
fValue( 0.0 ), m_fValue( 0.0 ),
bHasValue( false ), m_bHasValue( false ),
m_bHasStringValue(false), m_bHasStringValue(false),
m_bValueTypeIsString(false), m_bValueTypeIsString(false),
bProtect( false ), m_bProtect( false ),
nRowSpan( 1 ), m_nRowSpan( 1 ),
nColSpan( 1 ), m_nColSpan( 1 ),
nColRepeat( 1 ), m_nColRepeat( 1 ),
bHasTextContent( false ), m_bHasTextContent( false ),
bHasTableContent( false ) m_bHasTableContent( false )
{ {
sSaveParaDefault = GetImport().GetTextImport()->GetCellParaStyleDefault(); m_sSaveParaDefault = GetImport().GetTextImport()->GetCellParaStyleDefault();
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
for( sal_Int16 i=0; i < nAttrCount; i++ ) for( sal_Int16 i=0; i < nAttrCount; i++ )
{ {
...@@ -471,31 +471,31 @@ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl( ...@@ -471,31 +471,31 @@ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl(
mXmlId = rValue; mXmlId = rValue;
break; break;
case XML_TOK_TABLE_STYLE_NAME: case XML_TOK_TABLE_STYLE_NAME:
aStyleName = rValue; m_aStyleName = rValue;
GetImport().GetTextImport()->SetCellParaStyleDefault(rValue); GetImport().GetTextImport()->SetCellParaStyleDefault(rValue);
break; break;
case XML_TOK_TABLE_NUM_COLS_SPANNED: case XML_TOK_TABLE_NUM_COLS_SPANNED:
nColSpan = static_cast<sal_uInt32>(std::max<sal_Int32>(1, rValue.toInt32())); m_nColSpan = static_cast<sal_uInt32>(std::max<sal_Int32>(1, rValue.toInt32()));
if (nColSpan > 256) if (m_nColSpan > 256)
{ {
SAL_INFO("sw.xml", "ignoring huge table:number-columns-spanned " << nColSpan); SAL_INFO("sw.xml", "ignoring huge table:number-columns-spanned " << m_nColSpan);
nColSpan = 1; m_nColSpan = 1;
} }
break; break;
case XML_TOK_TABLE_NUM_ROWS_SPANNED: case XML_TOK_TABLE_NUM_ROWS_SPANNED:
nRowSpan = static_cast<sal_uInt32>(std::max<sal_Int32>(1, rValue.toInt32())); m_nRowSpan = static_cast<sal_uInt32>(std::max<sal_Int32>(1, rValue.toInt32()));
if (nRowSpan > 8192 || (nRowSpan > 256 && utl::ConfigManager::IsFuzzing())) if (m_nRowSpan > 8192 || (m_nRowSpan > 256 && utl::ConfigManager::IsFuzzing()))
{ {
SAL_INFO("sw.xml", "ignoring huge table:number-rows-spanned " << nRowSpan); SAL_INFO("sw.xml", "ignoring huge table:number-rows-spanned " << m_nRowSpan);
nRowSpan = 1; m_nRowSpan = 1;
} }
break; break;
case XML_TOK_TABLE_NUM_COLS_REPEATED: case XML_TOK_TABLE_NUM_COLS_REPEATED:
nColRepeat = static_cast<sal_uInt32>(std::max<sal_Int32>(1, rValue.toInt32())); m_nColRepeat = static_cast<sal_uInt32>(std::max<sal_Int32>(1, rValue.toInt32()));
if (nColRepeat > 256) if (m_nColRepeat > 256)
{ {
SAL_INFO("sw.xml", "ignoring huge table:number-columns-repeated " << nColRepeat); SAL_INFO("sw.xml", "ignoring huge table:number-columns-repeated " << m_nColRepeat);
nColRepeat = 1; m_nColRepeat = 1;
} }
break; break;
case XML_TOK_TABLE_FORMULA: case XML_TOK_TABLE_FORMULA:
...@@ -503,7 +503,7 @@ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl( ...@@ -503,7 +503,7 @@ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl(
OUString sTmp; OUString sTmp;
const sal_uInt16 nPrefix2 = GetImport().GetNamespaceMap(). const sal_uInt16 nPrefix2 = GetImport().GetNamespaceMap().
GetKeyByAttrName_( rValue, &sTmp ); GetKeyByAttrName_( rValue, &sTmp );
sFormula = XML_NAMESPACE_OOOW == nPrefix2 ? sTmp : rValue; m_sFormula = XML_NAMESPACE_OOOW == nPrefix2 ? sTmp : rValue;
} }
break; break;
case XML_TOK_TABLE_VALUE: case XML_TOK_TABLE_VALUE:
...@@ -511,8 +511,8 @@ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl( ...@@ -511,8 +511,8 @@ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl(
double fTmp; double fTmp;
if (::sax::Converter::convertDouble(fTmp, rValue)) if (::sax::Converter::convertDouble(fTmp, rValue))
{ {
fValue = fTmp; m_fValue = fTmp;
bHasValue = true; m_bHasValue = true;
} }
} }
break; break;
...@@ -521,8 +521,8 @@ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl( ...@@ -521,8 +521,8 @@ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl(
double fTmp; double fTmp;
if (::sax::Converter::convertDuration(fTmp, rValue)) if (::sax::Converter::convertDuration(fTmp, rValue))
{ {
fValue = fTmp; m_fValue = fTmp;
bHasValue = true; m_bHasValue = true;
} }
} }
break; break;
...@@ -532,8 +532,8 @@ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl( ...@@ -532,8 +532,8 @@ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl(
if (GetImport().GetMM100UnitConverter().convertDateTime(fTmp, if (GetImport().GetMM100UnitConverter().convertDateTime(fTmp,
rValue)) rValue))
{ {
fValue = fTmp; m_fValue = fTmp;
bHasValue = true; m_bHasValue = true;
} }
} }
break; break;
...@@ -542,8 +542,8 @@ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl( ...@@ -542,8 +542,8 @@ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl(
bool bTmp(false); bool bTmp(false);
if (::sax::Converter::convertBool(bTmp, rValue)) if (::sax::Converter::convertBool(bTmp, rValue))
{ {
fValue = (bTmp ? 1.0 : 0.0); m_fValue = (bTmp ? 1.0 : 0.0);
bHasValue = true; m_bHasValue = true;
} }
} }
break; break;
...@@ -552,7 +552,7 @@ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl( ...@@ -552,7 +552,7 @@ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl(
bool bTmp(false); bool bTmp(false);
if (::sax::Converter::convertBool(bTmp, rValue)) if (::sax::Converter::convertBool(bTmp, rValue))
{ {
bProtect = bTmp; m_bProtect = bTmp;
} }
} }
break; break;
...@@ -581,26 +581,26 @@ inline void SwXMLTableCellContext_Impl::InsertContent_() ...@@ -581,26 +581,26 @@ inline void SwXMLTableCellContext_Impl::InsertContent_()
{ {
SwStartNode const*const pStartNode( GetTable()->InsertTableSection(nullptr, SwStartNode const*const pStartNode( GetTable()->InsertTableSection(nullptr,
(m_bHasStringValue && m_bValueTypeIsString && (m_bHasStringValue && m_bValueTypeIsString &&
!aStyleName.isEmpty()) ? & aStyleName : nullptr) ); !m_aStyleName.isEmpty()) ? & m_aStyleName : nullptr) );
GetTable()->InsertCell( aStyleName, nRowSpan, nColSpan, GetTable()->InsertCell( m_aStyleName, m_nRowSpan, m_nColSpan,
pStartNode, pStartNode,
mXmlId, mXmlId,
nullptr, bProtect, &sFormula, bHasValue, fValue, nullptr, m_bProtect, &m_sFormula, m_bHasValue, m_fValue,
(m_bHasStringValue && m_bValueTypeIsString) ? &m_StringValue : nullptr); (m_bHasStringValue && m_bValueTypeIsString) ? &m_StringValue : nullptr);
} }
inline void SwXMLTableCellContext_Impl::InsertContent() inline void SwXMLTableCellContext_Impl::InsertContent()
{ {
OSL_ENSURE( !HasContent(), "content already there" ); OSL_ENSURE( !HasContent(), "content already there" );
bHasTextContent = true; m_bHasTextContent = true;
InsertContent_(); InsertContent_();
} }
inline void SwXMLTableCellContext_Impl::InsertContent( inline void SwXMLTableCellContext_Impl::InsertContent(
SwXMLTableContext *pTable ) SwXMLTableContext *pTable )
{ {
GetTable()->InsertCell( aStyleName, nRowSpan, nColSpan, nullptr, mXmlId, pTable, bProtect ); GetTable()->InsertCell( m_aStyleName, m_nRowSpan, m_nColSpan, nullptr, mXmlId, pTable, m_bProtect );
bHasTableContent = true; m_bHasTableContent = true;
} }
SvXMLImportContextRef SwXMLTableCellContext_Impl::CreateChildContext( SvXMLImportContextRef SwXMLTableCellContext_Impl::CreateChildContext(
...@@ -670,10 +670,10 @@ void SwXMLTableCellContext_Impl::EndElement() ...@@ -670,10 +670,10 @@ void SwXMLTableCellContext_Impl::EndElement()
{ {
if( GetTable()->IsValid() ) if( GetTable()->IsValid() )
{ {
if( bHasTextContent ) if( m_bHasTextContent )
{ {
GetImport().GetTextImport()->DeleteParagraph(); GetImport().GetTextImport()->DeleteParagraph();
if( nColRepeat > 1 && nColSpan == 1 ) if( m_nColRepeat > 1 && m_nColSpan == 1 )
{ {
// The original text is invalid after deleting the last // The original text is invalid after deleting the last
// paragraph // paragraph
...@@ -690,7 +690,7 @@ void SwXMLTableCellContext_Impl::EndElement() ...@@ -690,7 +690,7 @@ void SwXMLTableCellContext_Impl::EndElement()
SwDoc *pDoc = pSrcTextCursor->GetDoc(); SwDoc *pDoc = pSrcTextCursor->GetDoc();
const SwPaM *pSrcPaM = pSrcTextCursor->GetPaM(); const SwPaM *pSrcPaM = pSrcTextCursor->GetPaM();
while( nColRepeat > 1 && GetTable()->IsInsertCellPossible() ) while( m_nColRepeat > 1 && GetTable()->IsInsertCellPossible() )
{ {
InsertContent_(); InsertContent_();
...@@ -704,24 +704,24 @@ void SwXMLTableCellContext_Impl::EndElement() ...@@ -704,24 +704,24 @@ void SwXMLTableCellContext_Impl::EndElement()
SwPosition aDstPos( *pDstTextCursor->GetPaM()->GetPoint() ); SwPosition aDstPos( *pDstTextCursor->GetPaM()->GetPoint() );
pDoc->getIDocumentContentOperations().CopyRange( aSrcPaM, aDstPos, /*bCopyAll=*/false, /*bCheckPos=*/true ); pDoc->getIDocumentContentOperations().CopyRange( aSrcPaM, aDstPos, /*bCopyAll=*/false, /*bCheckPos=*/true );
nColRepeat--; m_nColRepeat--;
} }
} }
} }
else if( !bHasTableContent ) else if( !m_bHasTableContent )
{ {
InsertContent(); InsertContent();
if( nColRepeat > 1 && nColSpan == 1 ) if( m_nColRepeat > 1 && m_nColSpan == 1 )
{ {
while( nColRepeat > 1 && GetTable()->IsInsertCellPossible() ) while( m_nColRepeat > 1 && GetTable()->IsInsertCellPossible() )
{ {
InsertContent_(); InsertContent_();
nColRepeat--; m_nColRepeat--;
} }
} }
} }
} }
GetImport().GetTextImport()->SetCellParaStyleDefault(sSaveParaDefault); GetImport().GetTextImport()->SetCellParaStyleDefault(m_sSaveParaDefault);
} }
class SwXMLTableColContext_Impl : public SvXMLImportContext class SwXMLTableColContext_Impl : public SvXMLImportContext
......
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