diff options
-rw-r--r-- | sw/inc/doc.hxx | 2 | ||||
-rw-r--r-- | sw/inc/swtable.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/tblrwcl.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/docnode/ndcopy.cxx | 1 | ||||
-rw-r--r-- | sw/source/core/docnode/ndtbl.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/edit/edglss.cxx | 2 |
6 files changed, 8 insertions, 6 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index d5c3a210af42..361bf3494c37 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1268,7 +1268,7 @@ public: bool InsCopyOfTable( SwPosition& rInsPos, const SwSelBoxes& rBoxes, const SwTable* pCpyTable, bool bCpyName = false, - bool bCorrPos = false ); + bool bCorrPos = false, const OUString& rStyleName = "" ); void UnProtectCells( const OUString& rTableName ); bool UnProtectCells( const SwSelBoxes& rBoxes ); diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx index 8838c54ec76e..6c98d5bed360 100644 --- a/sw/inc/swtable.hxx +++ b/sw/inc/swtable.hxx @@ -278,7 +278,7 @@ public: const bool bPerformValidCheck = false ) const; // Copy selected boxes to another document. bool MakeCopy( SwDoc&, const SwPosition&, const SwSelBoxes&, - bool bCpyName = false ) const; + bool bCpyName = false, const OUString& rStyleName = "" ) const; // Copy table in this bool InsTable( const SwTable& rCpyTable, const SwNodeIndex&, SwUndoTableCpyTable* pUndo ); diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index 18eab679a289..7b5367255fda 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -2045,7 +2045,7 @@ void SwTable::CopyHeadlineIntoTable( SwTableNode& rTableNd ) bool SwTable::MakeCopy( SwDoc& rInsDoc, const SwPosition& rPos, const SwSelBoxes& rSelBoxes, - bool bCpyName ) const + bool bCpyName, const OUString& rStyleName ) const { // Find all Boxes/Lines FndBox_ aFndBox( nullptr, nullptr ); @@ -2081,6 +2081,7 @@ bool SwTable::MakeCopy( SwDoc& rInsDoc, const SwPosition& rPos, pNewTable->SetTableStyleName(pTableNd->GetTable().GetTableStyleName()); + pTableNd->GetTable().SetTableStyleName(rStyleName); if( auto pSwDDETable = dynamic_cast<const SwDDETable*>(this) ) { // A DDE-Table is being copied diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx index 5b3c9edbd9db..91bb99d696b6 100644 --- a/sw/source/core/docnode/ndcopy.cxx +++ b/sw/source/core/docnode/ndcopy.cxx @@ -271,6 +271,7 @@ SwTableNode* SwTableNode::MakeCopy( SwDoc& rDoc, const SwNodeIndex& rIdx ) const SwNodeIndex aInsPos( *pEndNd ); SwTable& rTable = pTableNd->GetTable(); + rTable.SetTableStyleName(GetTable().GetTableStyleName()); rTable.RegisterToFormat( *pTableFormat ); rTable.SetRowsToRepeat( GetTable().GetRowsToRepeat() ); diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 2fb74d2734d7..d6c37d252d36 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -4284,7 +4284,7 @@ void SwDoc::ClearBoxNumAttrs( const SwNodeIndex& rNode ) * This method is called by edglss.cxx/fecopy.cxx */ bool SwDoc::InsCopyOfTable( SwPosition& rInsPos, const SwSelBoxes& rBoxes, - const SwTable* pCpyTable, bool bCpyName, bool bCorrPos ) + const SwTable* pCpyTable, bool bCpyName, bool bCorrPos, const OUString& rStyleName ) { bool bRet; @@ -4307,7 +4307,7 @@ bool SwDoc::InsCopyOfTable( SwPosition& rInsPos, const SwSelBoxes& rBoxes, { ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); bRet = pSrcTableNd->GetTable().MakeCopy( *this, rInsPos, rBoxes, - bCpyName ); + bCpyName, rStyleName ); } if( pUndo && bRet ) diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx index 536a0c1643ff..47791dc69a49 100644 --- a/sw/source/core/edit/edglss.cxx +++ b/sw/source/core/edit/edglss.cxx @@ -190,7 +190,7 @@ bool SwEditShell::CopySelToDoc( SwDoc& rInsDoc ) break; } } - bRet = rInsDoc.InsCopyOfTable( aPos, aBoxes, nullptr, bCpyTableNm ); + bRet = rInsDoc.InsCopyOfTable( aPos, aBoxes, nullptr, bCpyTableNm, false, pTableNd->GetTable().GetTableStyleName() ); } else bRet = false; |