<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/4.2.3">
</HEAD>
<BODY>
Here a copy of the mail I send to Cedric Bosdonnat… forgot to add the list as "Cc:".<BR>
<BR>
Hello<BR>
<BR>
Thanks you for asking me…<BR>
<BR>
When you select a cell in Writer the selection type is a mix of nsSelectionType::SEL_TBL_CELLS, nsSelectionType::SEL_TBL and nsSelectionType::SEL_TXT.<BR>
So when the lcl_CreateEmptyItemSet function is called directly with the nSelectionType (from rWrtShell.GetSelectionType()) the if statement "nSelectionType == nsSelectionType::SEL_TBL" is false.<BR>
<BR>
So in the SwFormatClipboard::Copy function there is another statement :
<PRE>
<HR NOSHADE SIZE="1" ALIGN="left">
        if( nSelectionType & nsSelectionType::SEL_TBL_CELLS )//only copy table attributes if really cells are selected (not only text in tables)
        {
                m_pTableItemSet = lcl_CreateEmptyItemSet( nsSelectionType::SEL_TBL, rPool );
                lcl_getTableAttributes( *m_pTableItemSet, rWrtShell );
        }
<HR NOSHADE SIZE="1" ALIGN="left">
</PRE>
That call lcl_CreateEmptyItemSet with just nsSelectionType::SEL_TBL if the real selection type contain nsSelectionType::SEL_TBL_CELLS.<BR>
<BR>
I found this way of doing a bit confusing and as tables parameters are handle separately in the whole format paintbrush code I thought that replacing :
<PRE>
<HR NOSHADE SIZE="1" ALIGN="left">
        m_pTableItemSet = lcl_CreateEmptyItemSet( nsSelectionType::SEL_TBL, rPool );
<HR NOSHADE SIZE="1" ALIGN="left">
</PRE>
by :
<PRE>
<HR NOSHADE SIZE="1" ALIGN="left">
        m_pTableItemSet = new SfxItemSet(rPool,
                SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_SHADOW, //SID_ATTR_BORDER_OUTER is inbetween
                RES_BACKGROUND, RES_SHADOW, //RES_BOX is inbetween
                SID_ATTR_BRUSH_ROW, SID_ATTR_BRUSH_TABLE,
                RES_BREAK, RES_BREAK,
                RES_PAGEDESC, RES_PAGEDESC,
                RES_LAYOUT_SPLIT, RES_LAYOUT_SPLIT,
                RES_ROW_SPLIT, RES_ROW_SPLIT,
                RES_KEEP, RES_KEEP,
                RES_FRAMEDIR, RES_FRAMEDIR,
                FN_PARAM_TABLE_HEADLINE, FN_PARAM_TABLE_HEADLINE,
                FN_TABLE_BOX_TEXTORIENTATION, FN_TABLE_BOX_TEXTORIENTATION,
                FN_TABLE_SET_VERT_ALIGN, FN_TABLE_SET_VERT_ALIGN,
                0);
<HR NOSHADE SIZE="1" ALIGN="left">
</PRE>
was not irrelevant.<BR>
<BR>
After this replacement was made there where no reasons keeping the "nSelectionType == nsSelectionType::SEL_TBL" block in the lcl_CreateEmptyItemSet function.<BR>
<BR>
I hope I answered your question.<BR>
<BR>
BEWARE : this patch need the first patch 0001-add-GetCurParAttr-and-GetPaMParAttr-in-SwEditShell from my preview mail <A HREF="http://lists.freedesktop.org/archives/libreoffice/2012-March/028157.html">http://lists.freedesktop.org/archives/libreoffice/2012-March/028157.html</A><BR>
<BR>
Regards<BR>
<BR>
Maxime de Roucy<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
--
Maxime de Roucy
Groupe LINAGORA - OSSA
80 rue Roque de Fillol
92800 PUTEAUX
Tel. : 0 810 251 251
</PRE>
<BR>
<BR>
<BR>
</TD>
</TR>
</TABLE>
Le jeudi 15 mars 2012 à 17:06 +0100, Cedric Bosdonnat a écrit :
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi Maxime,
On Wed, 2012-03-14 at 16:50 +0100, Maxime de Roucy wrote:
> Here is some new patchs on the format clipboard. The first just add some
> comment in the formatclipboard.hxx file. The second one depend on
> modifications I made in the previous patch
> 0001-add-GetCurParAttr-and-GetPaMParAttr-in-SwEditShell.patch which is
> itself dependant of the patch
> 0004-SwEditShell-use-of-the-STL-swap-function.patch which is waiting for
> moderator approval to be published in the mailing list.
I pushed the first patch to the master branch... but there is something
weird in the second patch. Why did you remove the case where
nSelectionType is a table selection?
I'll push the second patch once that question is clarified.
--
Cedric
</PRE>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>