combine duplicate code into shared method

Change-Id: I76d50a135153a7022b481e4025f9b5f948ce7efa
This commit is contained in:
Caolán McNamara
2015-06-09 09:43:43 +01:00
parent 3d47d9d9b9
commit fce7587b4d
2 changed files with 19 additions and 22 deletions

View File

@@ -1724,17 +1724,7 @@ void MSWordExportBase::WriteSpecialText( sal_uLong nStart, sal_uLong nEnd, sal_u
bool bOldPageDescs = m_bOutPageDescs; bool bOldPageDescs = m_bOutPageDescs;
m_bOutPageDescs = false; m_bOutPageDescs = false;
// bOutKF was setted / stored in WriteKF1 // bOutKF was setted / stored in WriteKF1
m_pCurPam = Writer::NewSwPaM( *m_pDoc, nStart, nEnd ); SetCurPam(nStart, nEnd);
// Tabelle in Sonderbereichen erkennen
if ( ( nStart != m_pCurPam->GetMark()->nNode.GetIndex() ) &&
m_pDoc->GetNodes()[ nStart ]->IsTableNode() )
{
m_pCurPam->GetMark()->nNode = nStart;
}
m_pOrigPam = m_pCurPam;
m_pCurPam->Exchange();
WriteText(); WriteText();
@@ -1799,6 +1789,21 @@ void WW8Export::WriteChar( sal_Unicode c )
Strm().WriteUChar( c ); Strm().WriteUChar( c );
} }
void MSWordExportBase::SetCurPam(sal_uLong nStt, sal_uLong nEnd)
{
m_pCurPam = Writer::NewSwPaM( *m_pDoc, nStt, nEnd );
// Recognize tables in special cases
if ( nStt != m_pCurPam->GetMark()->nNode.GetIndex() &&
m_pDoc->GetNodes()[ nStt ]->IsTableNode() )
{
m_pCurPam->GetMark()->nNode = nStt;
}
m_pOrigPam = m_pCurPam;
m_pCurPam->Exchange();
}
void MSWordExportBase::SaveData( sal_uLong nStt, sal_uLong nEnd ) void MSWordExportBase::SaveData( sal_uLong nStt, sal_uLong nEnd )
{ {
MSWordSaveData aData; MSWordSaveData aData;
@@ -1820,17 +1825,7 @@ void MSWordExportBase::SaveData( sal_uLong nStt, sal_uLong nEnd )
aData.bOldStartTOX = m_bStartTOX; aData.bOldStartTOX = m_bStartTOX;
aData.bOldInWriteTOX = m_bInWriteTOX; aData.bOldInWriteTOX = m_bInWriteTOX;
m_pCurPam = Writer::NewSwPaM( *m_pDoc, nStt, nEnd ); SetCurPam(nStt, nEnd);
// Recognize tables in special cases
if ( nStt != m_pCurPam->GetMark()->nNode.GetIndex() &&
m_pDoc->GetNodes()[ nStt ]->IsTableNode() )
{
m_pCurPam->GetMark()->nNode = nStt;
}
m_pOrigPam = m_pCurPam;
m_pCurPam->Exchange();
m_bOutTable = false; m_bOutTable = false;
// Caution: bIsInTable should not be set here // Caution: bIsInTable should not be set here

View File

@@ -860,6 +860,8 @@ protected:
const NfKeywordTable & GetNfKeywordTable(); const NfKeywordTable & GetNfKeywordTable();
void SetCurPam(sal_uLong nStt, sal_uLong nEnd);
/// Populates m_vecBulletPic with all the bullet graphics used by numberings. /// Populates m_vecBulletPic with all the bullet graphics used by numberings.
int CollectGrfsOfBullets(); int CollectGrfsOfBullets();
/// Write the numbering picture bullets. /// Write the numbering picture bullets.