1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: formatclipboard.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sw.hxx"
34 #include "formatclipboard.hxx"
37 #include <hintids.hxx>
38 #ifndef _SVX_SVXIDS_HRC
39 #include <svx/svxids.hrc>
45 #include <charfmt.hxx>
48 #include <docstyle.hxx>
49 #include <fchrfmt.hxx>
51 // header for class SdrView
52 #include <svx/svdview.hxx>
54 #include <svx/brshitem.hxx>
55 #include <svx/shaditem.hxx>
57 // header for class SvxBoxInfoItem
58 #include <svx/boxitem.hxx>
59 // header for class SvxFmtBreakItem
60 #include <svx/brkitem.hxx>
61 // header for class SwFmtLayoutSplit
62 #include <fmtlsplt.hxx>
63 // header for class SvxFmtKeepItem
64 #include <svx/keepitem.hxx>
65 // header for class SvxFrameDirectionItem
66 #include <svx/frmdiritem.hxx>
68 #include <fmtpdsc.hxx>
69 #include <fmtrowsplt.hxx>
70 #include <swundo.hxx> // fuer die UndoIds
71 #include <boost/shared_ptr.hpp>
73 //#define FORMAT_PAINTBRUSH_ALSO_COPY_NUMBERFORMAT_FOR_TABLES 1
75 #ifdef FORMAT_PAINTBRUSH_ALSO_COPY_NUMBERFORMAT_FOR_TABLES
76 #include <cellatr.hxx>
79 /*--------------------------------------------------------------------
80 --------------------------------------------------------------------*/
84 #define FORMAT_PAINTBRUSH_FRAME_IDS \
85 RES_FRMATR_BEGIN, RES_FILL_ORDER, \
86 /* no RES_FRM_SIZE */ \
87 RES_PAPER_BIN, RES_SURROUND, \
88 /* no RES_VERT_ORIENT */ \
89 /* no RES_HORI_ORIENT */ \
91 RES_BACKGROUND, RES_SHADOW, \
92 /* no RES_FRMMACRO */ \
95 RES_EDIT_IN_READONLY, RES_LAYOUT_SPLIT, \
97 RES_TEXTGRID, RES_FRMATR_END-1,
99 #define FORMAT_PAINTBRUSH_PARAGRAPH_IDS \
100 RES_PARATR_BEGIN, RES_PARATR_END -1, \
101 RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END -1, \
102 FORMAT_PAINTBRUSH_FRAME_IDS \
103 FN_NUMBER_NEWSTART, FN_NUMBER_NEWSTART, \
104 FN_NUMBER_NEWSTART_AT, FN_NUMBER_NEWSTART_AT,
106 SfxItemSet
* lcl_CreateEmptyItemSet( int nSelectionType
, SfxItemPool
& rPool
107 , bool bNoCharacterFormats
= false, bool bNoParagraphFormats
= false )
109 SfxItemSet
* pItemSet
= 0;
110 if( nSelectionType
& (nsSelectionType::SEL_FRM
| nsSelectionType::SEL_OLE
| nsSelectionType::SEL_GRF
) )
112 pItemSet
= new SfxItemSet(rPool
,
113 FORMAT_PAINTBRUSH_FRAME_IDS
116 else if( nSelectionType
& nsSelectionType::SEL_DRW
)
118 //is handled different
120 else if( nSelectionType
== nsSelectionType::SEL_TBL
)
122 pItemSet
= new SfxItemSet(rPool
,
123 SID_ATTR_BORDER_INNER
, SID_ATTR_BORDER_SHADOW
, //SID_ATTR_BORDER_OUTER is inbetween
124 RES_BACKGROUND
, RES_SHADOW
, //RES_BOX is inbetween
125 SID_ATTR_BRUSH_ROW
, SID_ATTR_BRUSH_TABLE
,
126 RES_BREAK
, RES_BREAK
,
127 RES_PAGEDESC
, RES_PAGEDESC
,
128 RES_LAYOUT_SPLIT
, RES_LAYOUT_SPLIT
,
129 RES_ROW_SPLIT
, RES_ROW_SPLIT
,
131 RES_FRAMEDIR
, RES_FRAMEDIR
,
132 FN_PARAM_TABLE_HEADLINE
, FN_PARAM_TABLE_HEADLINE
,
133 FN_TABLE_BOX_TEXTDIRECTION
, FN_TABLE_BOX_TEXTDIRECTION
,
134 FN_TABLE_SET_VERT_ALIGN
, FN_TABLE_SET_VERT_ALIGN
,
135 #ifdef FORMAT_PAINTBRUSH_ALSO_COPY_NUMBERFORMAT_FOR_TABLES
136 RES_BOXATR_FORMAT
, RES_BOXATR_FORMAT
,
140 else if( nSelectionType
& nsSelectionType::SEL_TXT
)
142 if( bNoCharacterFormats
)
143 pItemSet
= new SfxItemSet(rPool
,
144 FORMAT_PAINTBRUSH_PARAGRAPH_IDS
146 else if( bNoParagraphFormats
)
147 pItemSet
= new SfxItemSet(rPool
,
148 RES_CHRATR_BEGIN
, RES_CHRATR_END
- 1,
151 pItemSet
= new SfxItemSet(rPool
,
152 RES_CHRATR_BEGIN
, RES_CHRATR_END
- 1,
153 FORMAT_PAINTBRUSH_PARAGRAPH_IDS
159 void lcl_getTableAttributes( SfxItemSet
& rSet
, SwWrtShell
&rSh
)
161 SvxBrushItem
aBrush( RES_BACKGROUND
);
162 rSh
.GetBoxBackground(aBrush
);
164 if(rSh
.GetRowBackground(aBrush
))
165 rSet
.Put( aBrush
, SID_ATTR_BRUSH_ROW
);
167 rSet
.InvalidateItem(SID_ATTR_BRUSH_ROW
);
168 rSh
.GetTabBackground(aBrush
);
169 rSet
.Put( aBrush
, SID_ATTR_BRUSH_TABLE
);
171 SvxBoxInfoItem
aBoxInfo( SID_ATTR_BORDER_INNER
);
173 rSh
.GetTabBorders( rSet
);
175 SvxFrameDirectionItem
aBoxDirection( FRMDIR_ENVIRONMENT
, RES_FRAMEDIR
);
176 if(rSh
.GetBoxDirection( aBoxDirection
))
177 rSet
.Put(aBoxDirection
, FN_TABLE_BOX_TEXTDIRECTION
);
179 rSet
.Put(SfxUInt16Item(FN_TABLE_SET_VERT_ALIGN
, rSh
.GetBoxAlign()));
181 rSet
.Put( SfxUInt16Item( FN_PARAM_TABLE_HEADLINE
, rSh
.GetRowsToRepeat() ) );
183 SwFrmFmt
*pFrmFmt
= rSh
.GetTableFmt();
186 rSet
.Put( pFrmFmt
->GetShadow() );
187 rSet
.Put( pFrmFmt
->GetBreak() );
188 rSet
.Put( pFrmFmt
->GetPageDesc() );
189 rSet
.Put( pFrmFmt
->GetLayoutSplit() );
190 rSet
.Put( pFrmFmt
->GetKeep() );
191 rSet
.Put( pFrmFmt
->GetFrmDir() );
194 SwFmtRowSplit
* pSplit
= 0;
195 rSh
.GetRowSplit(pSplit
);
199 //-- numberformat in cells
200 #ifdef FORMAT_PAINTBRUSH_ALSO_COPY_NUMBERFORMAT_FOR_TABLES
201 rSh
.GetTblBoxFormulaAttrs( rSet
); //RES_BOXATR_FORMAT
205 void lcl_setTableAttributes( const SfxItemSet
& rSet
, SwWrtShell
&rSh
)
207 const SfxPoolItem
* pItem
= 0;
208 BOOL bBorder
= ( SFX_ITEM_SET
== rSet
.GetItemState( RES_BOX
) ||
209 SFX_ITEM_SET
== rSet
.GetItemState( SID_ATTR_BORDER_INNER
) );
211 BOOL bBackground
= SFX_ITEM_SET
== rSet
.GetItemState( RES_BACKGROUND
, FALSE
, &pItem
);
212 const SfxPoolItem
* pRowItem
= 0, *pTableItem
= 0;
213 bBackground
|= SFX_ITEM_SET
== rSet
.GetItemState( SID_ATTR_BRUSH_ROW
, FALSE
, &pRowItem
);
214 bBackground
|= SFX_ITEM_SET
== rSet
.GetItemState( SID_ATTR_BRUSH_TABLE
, FALSE
, &pTableItem
);
219 rSh
.SetBoxBackground( *(const SvxBrushItem
*)pItem
);
222 SvxBrushItem
aBrush(*(const SvxBrushItem
*)pRowItem
);
223 aBrush
.SetWhich(RES_BACKGROUND
);
224 rSh
.SetRowBackground(aBrush
);
228 SvxBrushItem
aBrush(*(const SvxBrushItem
*)pTableItem
);
229 aBrush
.SetWhich(RES_BACKGROUND
);
230 rSh
.SetTabBackground( aBrush
);
234 rSh
.SetTabBorders( rSet
);
236 if( SFX_ITEM_SET
== rSet
.GetItemState( FN_PARAM_TABLE_HEADLINE
, FALSE
, &pItem
) )
237 rSh
.SetRowsToRepeat( ((SfxUInt16Item
*)pItem
)->GetValue() );
239 SwFrmFmt
* pFrmFmt
= rSh
.GetTableFmt();
244 rSet
.GetItemState(rSet
.GetPool()->GetWhich(RES_SHADOW
), FALSE
, &pItem
);
246 pFrmFmt
->SetFmtAttr( *pItem
);
250 rSet
.GetItemState(rSet
.GetPool()->GetWhich(RES_BREAK
), FALSE
, &pItem
);
252 pFrmFmt
->SetFmtAttr( *pItem
);
256 rSet
.GetItemState(rSet
.GetPool()->GetWhich(RES_PAGEDESC
), FALSE
, &pItem
);
258 pFrmFmt
->SetFmtAttr( *pItem
);
262 rSet
.GetItemState(rSet
.GetPool()->GetWhich(RES_LAYOUT_SPLIT
), FALSE
, &pItem
);
264 pFrmFmt
->SetFmtAttr( *pItem
);
268 rSet
.GetItemState(rSet
.GetPool()->GetWhich(RES_KEEP
), FALSE
, &pItem
);
270 pFrmFmt
->SetFmtAttr( *pItem
);
274 rSet
.GetItemState(rSet
.GetPool()->GetWhich(RES_FRAMEDIR
), FALSE
, &pItem
);
276 pFrmFmt
->SetFmtAttr( *pItem
);
279 if( SFX_ITEM_SET
== rSet
.GetItemState( FN_TABLE_BOX_TEXTDIRECTION
, FALSE
, &pItem
) )
281 SvxFrameDirectionItem
aDirection( FRMDIR_ENVIRONMENT
, RES_FRAMEDIR
);
282 aDirection
.SetValue(static_cast< const SvxFrameDirectionItem
* >(pItem
)->GetValue());
283 rSh
.SetBoxDirection(aDirection
);
286 if( SFX_ITEM_SET
== rSet
.GetItemState( FN_TABLE_SET_VERT_ALIGN
, FALSE
, &pItem
))
287 rSh
.SetBoxAlign(((SfxUInt16Item
*)(pItem
))->GetValue());
289 if( SFX_ITEM_SET
== rSet
.GetItemState( RES_ROW_SPLIT
, FALSE
, &pItem
) )
290 rSh
.SetRowSplit(*static_cast<const SwFmtRowSplit
*>(pItem
));
292 //-- numberformat in cells
293 #ifdef FORMAT_PAINTBRUSH_ALSO_COPY_NUMBERFORMAT_FOR_TABLES
294 if( SFX_ITEM_SET
== rSet
.GetItemState( RES_BOXATR_FORMAT
, FALSE
, &pItem
))
296 SfxItemSet
aBoxSet( *rSet
.GetPool(), RES_BOXATR_FORMAT
, RES_BOXATR_FORMAT
);
297 aBoxSet
.Put( SwTblBoxNumFormat( ((SfxUInt32Item
*)pItem
)->GetValue() ));
298 rSh
.SetTblBoxFormulaAttrs( aBoxSet
);
303 }//end anonymous namespace
305 SwFormatClipboard::SwFormatClipboard()
306 : m_nSelectionType(0)
309 , m_bPersistentCopy(false)
312 SwFormatClipboard::~SwFormatClipboard()
317 delete m_pTableItemSet
;
320 bool SwFormatClipboard::HasContent() const
323 || m_pTableItemSet
!= 0
324 || m_aCharStyle
.Len()
325 || m_aParaStyle
.Len()
328 bool SwFormatClipboard::HasContentForThisType( int nSelectionType
) const
333 if( m_nSelectionType
== nSelectionType
)
336 if( ( nSelectionType
& (nsSelectionType::SEL_FRM
| nsSelectionType::SEL_OLE
| nsSelectionType::SEL_GRF
) )
338 ( m_nSelectionType
& (nsSelectionType::SEL_FRM
| nsSelectionType::SEL_OLE
| nsSelectionType::SEL_GRF
) )
342 if( nSelectionType
& nsSelectionType::SEL_TXT
&& m_nSelectionType
& nsSelectionType::SEL_TXT
)
348 bool SwFormatClipboard::CanCopyThisType( int nSelectionType
) const
350 if( nSelectionType
& (nsSelectionType::SEL_FRM
| nsSelectionType::SEL_OLE
| nsSelectionType::SEL_GRF
351 | nsSelectionType::SEL_TXT
| nsSelectionType::SEL_DRW
| nsSelectionType::SEL_TBL
| nsSelectionType::SEL_TBL_CELLS
) )
356 void SwFormatClipboard::Copy( SwWrtShell
& rWrtShell
, SfxItemPool
& rPool
, bool bPersistentCopy
)
359 m_bPersistentCopy
= bPersistentCopy
;
361 int nSelectionType
= rWrtShell
.GetSelectionType();
362 SfxItemSet
* pItemSet
= lcl_CreateEmptyItemSet( nSelectionType
, rPool
);
364 rWrtShell
.StartAction();
366 if( nSelectionType
== nsSelectionType::SEL_TXT
)
368 SwPaM
* pCrsr
= rWrtShell
.GetCrsr();
369 //select one character only to get the attributes of this single character only
370 BOOL bHasSelection
= pCrsr
->HasMark();
371 BOOL bForwardSelection
= FALSE
;
373 if(!bHasSelection
) //check for and handle multiselections
375 if( pCrsr
->GetPrev() != pCrsr
&& pCrsr
->GetPrev() != 0)
377 pCrsr
= (SwPaM
*)pCrsr
->GetPrev();
378 bForwardSelection
= (*pCrsr
->GetPoint()) > (*pCrsr
->GetMark());
379 bHasSelection
= true;
382 rWrtShell
.KillPams();
383 pCrsr
= rWrtShell
.GetCrsr();
387 bForwardSelection
= (*pCrsr
->GetPoint()) > (*pCrsr
->GetMark());
391 if( !bHasSelection
&& rWrtShell
.IsInRightToLeftText() )
392 bForwardSelection
= !bForwardSelection
;
394 if( !( !bHasSelection
&& rWrtShell
.IsEndPara() ) )
395 pCrsr
->Move( bForwardSelection
? fnMoveBackward
: fnMoveForward
);
400 if( nSelectionType
& (nsSelectionType::SEL_FRM
| nsSelectionType::SEL_OLE
| nsSelectionType::SEL_GRF
) )
401 rWrtShell
.GetFlyFrmAttr(*pItemSet
);
404 rWrtShell
.GetCurAttr(*pItemSet
);
406 // additional numbering properties for paragraph styles
407 if( nSelectionType
& nsSelectionType::SEL_TXT
&& rWrtShell
.GetCurNumRule() )
409 SfxBoolItem
aStart(FN_NUMBER_NEWSTART
, rWrtShell
.IsNumRuleStart());
410 pItemSet
->Put(aStart
);
411 SfxUInt16Item
aStartAt(FN_NUMBER_NEWSTART_AT
, rWrtShell
.GetNodeNumStart());
412 pItemSet
->Put(aStartAt
);
416 else if ( nSelectionType
& nsSelectionType::SEL_DRW
)
418 SdrView
* pDrawView
= rWrtShell
.GetDrawView();
421 BOOL bOnlyHardAttr
= TRUE
;
422 if( pDrawView
->AreObjectsMarked() )
424 pItemSet
= new SfxItemSet( pDrawView
->GetAttrFromMarked(bOnlyHardAttr
) );
425 //remove attributes defining the type/data of custom shapes
426 pItemSet
->ClearItem(SDRATTR_CUSTOMSHAPE_ENGINE
);
427 pItemSet
->ClearItem(SDRATTR_CUSTOMSHAPE_DATA
);
428 pItemSet
->ClearItem(SDRATTR_CUSTOMSHAPE_GEOMETRY
);
429 pItemSet
->ClearItem(SDRATTR_CUSTOMSHAPE_REPLACEMENT_URL
);
433 if( nSelectionType
& nsSelectionType::SEL_TBL_CELLS
)//only copy table attributes if really cells are selected (not only text in tables)
435 m_pTableItemSet
= lcl_CreateEmptyItemSet( nsSelectionType::SEL_TBL
, rPool
);
436 lcl_getTableAttributes( *m_pTableItemSet
, rWrtShell
);
439 m_nSelectionType
= nSelectionType
;
440 m_pItemSet
= pItemSet
;
442 if( nSelectionType
& nsSelectionType::SEL_TXT
)
444 SwFmt
* pFmt
= rWrtShell
.GetCurCharFmt();
446 m_aCharStyle
= pFmt
->GetName();
448 pFmt
= rWrtShell
.GetCurTxtFmtColl();
450 m_aParaStyle
= pFmt
->GetName();
452 rWrtShell
.Pop(FALSE
);
453 rWrtShell
.EndAction();
455 typedef boost::shared_ptr
< SfxPoolItem
> SfxPoolItemSharedPtr
;
456 typedef std::vector
< SfxPoolItemSharedPtr
> ItemVector
;
457 // #144857# collect all PoolItems from the applied styles
458 void lcl_AppendSetItems( ItemVector
& rItemVector
, const SfxItemSet
& rStyleAttrSet
)
460 const USHORT
* pRanges
= rStyleAttrSet
.GetRanges();
463 for ( USHORT nWhich
= *pRanges
; nWhich
<= *(pRanges
+1); ++nWhich
)
465 const SfxPoolItem
* pItem
;
466 if( SFX_ITEM_SET
== rStyleAttrSet
.GetItemState( nWhich
, sal_False
, &pItem
) )
468 rItemVector
.push_back( SfxPoolItemSharedPtr( pItem
->Clone() ) );
474 // #144857# remove all items that are inherited from the styles
475 void lcl_RemoveEqualItems( SfxItemSet
& rTemplateItemSet
, ItemVector
& rItemVector
)
477 ItemVector::iterator aEnd
= rItemVector
.end();
478 ItemVector::iterator aIter
= rItemVector
.begin();
479 while( aIter
!= aEnd
)
481 const SfxPoolItem
* pItem
;
482 if( SFX_ITEM_SET
== rTemplateItemSet
.GetItemState( (*aIter
)->Which(), sal_True
, &pItem
) &&
483 *pItem
== *(*aIter
) )
485 rTemplateItemSet
.ClearItem( (*aIter
)->Which() );
491 void SwFormatClipboard::Paste( SwWrtShell
& rWrtShell
, SfxStyleSheetBasePool
* pPool
492 , bool bNoCharacterFormats
, bool bNoParagraphFormats
)
494 int nSelectionType
= rWrtShell
.GetSelectionType();
495 if( !this->HasContentForThisType(nSelectionType
) )
497 if(!m_bPersistentCopy
)
502 rWrtShell
.StartAction();
503 rWrtShell
.StartUndo(UNDO_INSATTR
);
505 ItemVector aItemVector
;
506 if(pPool
) //to find the styles we need the pool
508 if( nSelectionType
& nsSelectionType::SEL_TXT
)
510 if(m_aCharStyle
.Len() && !bNoCharacterFormats
)
512 SwDocStyleSheet
* pStyle
= (SwDocStyleSheet
*)pPool
->Find(m_aCharStyle
, SFX_STYLE_FAMILY_CHAR
);
515 SwFmtCharFmt
aFmt(pStyle
->GetCharFmt());
516 // #144857# collect items from character style
517 lcl_AppendSetItems( aItemVector
, aFmt
.GetCharFmt()->GetAttrSet());
518 USHORT nFlags
=0; //(nMode & KEY_SHIFT) ? SETATTR_DONTREPLACE : SETATTR_DEFAULT;
519 rWrtShell
.SetAttr( aFmt
, nFlags
);
522 if(m_aParaStyle
.Len() && !bNoParagraphFormats
)
524 SwDocStyleSheet
* pStyle
= (SwDocStyleSheet
*)pPool
->Find(m_aParaStyle
, SFX_STYLE_FAMILY_PARA
);
527 // #144857# collect items from paragraph style
528 lcl_AppendSetItems( aItemVector
, pStyle
->GetCollection()->GetAttrSet());
529 rWrtShell
.SetTxtFmtColl( pStyle
->GetCollection() );
536 if( nSelectionType
& nsSelectionType::SEL_DRW
)
538 SdrView
* pDrawView
= rWrtShell
.GetDrawView();
541 BOOL bReplaceAll
= TRUE
;
542 pDrawView
->SetAttrToMarked(*m_pItemSet
, bReplaceAll
);
547 SfxItemSet
* pTemplateItemSet
= lcl_CreateEmptyItemSet(
548 nSelectionType
, *m_pItemSet
->GetPool()
549 , bNoCharacterFormats
, bNoParagraphFormats
);
552 pTemplateItemSet
->Put( *m_pItemSet
);
553 // #144857# only _set_ attributes that differ from style attributes should be applied - the style is applied anyway
554 lcl_RemoveEqualItems( *pTemplateItemSet
, aItemVector
);
556 if( nSelectionType
& (nsSelectionType::SEL_FRM
| nsSelectionType::SEL_OLE
| nsSelectionType::SEL_GRF
) )
557 rWrtShell
.SetFlyFrmAttr(*pTemplateItemSet
);
560 rWrtShell
.SetAttr(*pTemplateItemSet
);
562 // additional numbering properties for paragraph styles
563 if( nSelectionType
& nsSelectionType::SEL_TXT
&& rWrtShell
.GetCurNumRule() )
565 if( SFX_ITEM_SET
== pTemplateItemSet
->GetItemState(FN_NUMBER_NEWSTART
) )
567 BOOL bStart
= ((SfxBoolItem
&)pTemplateItemSet
->Get(FN_NUMBER_NEWSTART
)).GetValue();
568 USHORT nNumStart
= USHRT_MAX
;
569 if( SFX_ITEM_SET
== pTemplateItemSet
->GetItemState(FN_NUMBER_NEWSTART_AT
) )
571 nNumStart
= ((SfxUInt16Item
&)pTemplateItemSet
->Get(FN_NUMBER_NEWSTART_AT
)).GetValue();
572 if(USHRT_MAX
!= nNumStart
)
575 rWrtShell
.SetNumRuleStart(bStart
);
576 rWrtShell
.SetNodeNumStart(nNumStart
);
578 else if( SFX_ITEM_SET
== pTemplateItemSet
->GetItemState(FN_NUMBER_NEWSTART_AT
) )
580 USHORT nNumStart
= ((SfxUInt16Item
&)pTemplateItemSet
->Get(FN_NUMBER_NEWSTART_AT
)).GetValue();
581 rWrtShell
.SetNodeNumStart(nNumStart
);
582 rWrtShell
.SetNumRuleStart(FALSE
);
586 delete pTemplateItemSet
;
591 if( m_pTableItemSet
&& nSelectionType
& (nsSelectionType::SEL_TBL
| nsSelectionType::SEL_TBL_CELLS
) )
592 lcl_setTableAttributes( *m_pTableItemSet
, rWrtShell
);
594 rWrtShell
.EndUndo(UNDO_INSATTR
);
595 rWrtShell
.EndAction();
597 if(!m_bPersistentCopy
)
601 void SwFormatClipboard::Erase()
603 m_nSelectionType
= 0;
611 delete m_pTableItemSet
;
614 if( m_aCharStyle
.Len() )
615 m_aCharStyle
.Erase();
616 if( m_aParaStyle
.Len() )
617 m_aParaStyle
.Erase();
619 m_bPersistentCopy
= false;