diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-03-21 17:15:06 +0100 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2012-03-26 17:12:58 +0200 |
commit | c646eaa216842443bb9bf88caf22f1805006dcc9 (patch) | |
tree | 752f28b4c98a1fe465f8a89c34def742f4f7170e | |
parent | befb1c7e26b79ae97d802659f3386882d4044251 (diff) |
fdo#45522: WW8TableInfo::processSwTable: check that table has layout
(cherry picked from commit 5c3dd5af41bc801ee6023513399c01c632dc7779)
Signed-off-by: Michael Stahl <mstahl@redhat.com>
Signed-off-by: Miklos Vajna <vmiklos@suse.cz>
Signed-off-by: Petr Mladek <pmladek@suse.cz>
-rw-r--r-- | sw/inc/swtable.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/table/swtable.cxx | 7 | ||||
-rw-r--r-- | sw/source/filter/ww8/WW8TableInfo.cxx | 3 |
3 files changed, 10 insertions, 2 deletions
diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx index fb1d253b3879..73df08c088ea 100644 --- a/sw/inc/swtable.hxx +++ b/sw/inc/swtable.hxx @@ -326,6 +326,8 @@ public: #ifdef DBG_UTIL void CheckConsistency() const; #endif + + bool HasLayout() const; }; class SW_DLLPUBLIC SwTableLine: public SwClient // Client of FrmFmt. diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index ae36c31f809d..d9612892e23f 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -2804,6 +2804,13 @@ void SwTable::RegisterToFormat( SwFmt& rFmt ) rFmt.Add( this ); } +bool SwTable::HasLayout() const +{ + const SwFrmFmt* pFrmFmt = GetFrmFmt(); + //a table in a clipboard document doesn't have any layout information + return pFrmFmt && SwIterator<SwTabFrm,SwFmt>::FirstElement(*pFrmFmt); +} + void SwTableLine::RegisterToFormat( SwFmt& rFmt ) { rFmt.Add( this ); diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx index 6171430d5355..095c94b89f31 100644 --- a/sw/source/filter/ww8/WW8TableInfo.cxx +++ b/sw/source/filter/ww8/WW8TableInfo.cxx @@ -631,8 +631,7 @@ void WW8TableInfo::processSwTable(const SwTable * pTable) WW8TableNodeInfo * pPrev = NULL; - SwFrmFmt * pFrmFmt = pTable->GetFrmFmt(); - if (pFrmFmt != NULL && pTable->IsTblComplex()) + if (pTable->IsTblComplex() && pTable->HasLayout()) { pPrev = processSwTableByLayout(pTable); |