[Libreoffice-commits] .: 29 commits - sw/inc sw/source
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Sat Mar 19 10:20:13 PDT 2011
sw/inc/fmtclds.hxx | 6
sw/inc/pagedesc.hxx | 18 -
sw/inc/unomap.hxx | 1
sw/inc/unomid.h | 1
sw/inc/unoprnms.hxx | 4
sw/inc/unosett.hxx | 3
sw/source/core/doc/poolfmt.cxx | 4
sw/source/core/docnode/ndtbl.cxx | 5
sw/source/core/edit/autofmt.cxx | 26 --
sw/source/core/inc/frame.hxx | 9
sw/source/core/layout/atrfrm.cxx | 14 +
sw/source/core/layout/pagedesc.cxx | 4
sw/source/core/layout/paintfrm.cxx | 342 +++++++++++++--------------
sw/source/core/unocore/unomap.cxx | 2
sw/source/core/unocore/unoprnms.cxx | 2
sw/source/core/unocore/unosett.cxx | 26 +-
sw/source/core/unocore/unotbl.cxx | 25 +
sw/source/filter/html/css1atr.cxx | 58 ++--
sw/source/filter/html/htmlgrin.cxx | 17 -
sw/source/filter/html/htmltab.cxx | 21 -
sw/source/filter/html/svxcss1.cxx | 141 +++--------
sw/source/filter/html/svxcss1.hxx | 4
sw/source/filter/html/swhtml.cxx | 12
sw/source/filter/ww1/w1sprm.cxx | 27 --
sw/source/filter/ww8/docxattributeoutput.cxx | 90 ++++---
sw/source/filter/ww8/rtfattributeoutput.cxx | 125 ++++-----
sw/source/filter/ww8/wrtw8esh.cxx | 7
sw/source/filter/ww8/ww8atr.cxx | 56 +++-
sw/source/filter/ww8/ww8graf.cxx | 171 +------------
sw/source/filter/ww8/ww8par2.cxx | 4
sw/source/filter/ww8/ww8par6.cxx | 173 +++----------
sw/source/filter/ww8/ww8scan.cxx | 121 ---------
sw/source/filter/ww8/ww8struc.hxx | 19 -
sw/source/filter/xml/xmlexpit.cxx | 98 +++++--
sw/source/filter/xml/xmlimpit.cxx | 12
sw/source/filter/xml/xmlithlp.cxx | 156 ++----------
sw/source/ui/frmdlg/colmgr.cxx | 7
sw/source/ui/frmdlg/column.cxx | 92 +++++--
sw/source/ui/frmdlg/column.hrc | 6
sw/source/ui/frmdlg/column.src | 53 +++-
sw/source/ui/inc/colmgr.hxx | 8
sw/source/ui/inc/column.hxx | 4
sw/source/ui/inc/pgfnote.hxx | 10
sw/source/ui/misc/pgfnote.cxx | 140 +++++++----
sw/source/ui/misc/pgfnote.hrc | 9
sw/source/ui/misc/pgfnote.src | 54 +++-
sw/source/ui/shells/frmsh.cxx | 16 -
sw/source/ui/shells/tabsh.cxx | 15 -
sw/source/ui/utlui/uiitems.cxx | 26 ++
49 files changed, 1045 insertions(+), 1199 deletions(-)
New commits:
commit 86eb316ee96cb3bb2107401f253ddf633a3c9f58
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Fri Mar 18 10:05:24 2011 +0100
i#12441: added ui for footnote separator color selection
diff --git a/sw/source/ui/inc/pgfnote.hxx b/sw/source/ui/inc/pgfnote.hxx
index ac8baa8..30efd28 100644
--- a/sw/source/ui/inc/pgfnote.hxx
+++ b/sw/source/ui/inc/pgfnote.hxx
@@ -67,6 +67,8 @@ private:
LineListBox aLineTypeBox;
FixedText aLineWidthLbl;
MetricField aLineWidthEdit;
+ FixedText aLineColorLbl;
+ ColorListBox aLineColorBox;
FixedText aLineLengthLbl;
MetricField aLineLengthEdit;
FixedText aLineDistLbl;
@@ -76,6 +78,7 @@ private:
DECL_LINK( HeightMetric, Button * );
DECL_LINK( HeightModify, MetricField * );
DECL_LINK( LineWidthChanged_Impl, void * );
+ DECL_LINK( LineColorSelected_Impl, void * );
long lMaxHeight;
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index b95ad34..80163c6 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -39,6 +39,8 @@
#include <hintids.hxx>
#include <tools/ref.hxx>
#include <svx/dialogs.hrc>
+#include <svx/drawitem.hxx>
+#include <svx/xtable.hxx> // XColorTable
#include <sal/macros.h>
#include <vcl/field.hxx>
#include <vcl/svapp.hxx>
@@ -53,6 +55,7 @@
#include <pagedesc.hxx>
#include <pgfnote.hxx>
#include <uiitems.hxx>
+#include <sfx2/objsh.hxx>
#include <globals.hrc>
#include <misc.hrc>
@@ -119,6 +122,12 @@ IMPL_LINK( SwFootNotePage, LineWidthChanged_Impl, void *, EMPTYARG )
return 0;
}
+IMPL_LINK( SwFootNotePage, LineColorSelected_Impl, void *, EMPTYARG )
+{
+ aLineTypeBox.SetColor( aLineColorBox.GetSelectEntryColor() );
+ return 0;
+}
+
// CTOR / DTOR -----------------------------------------------------------
SwFootNotePage::SwFootNotePage(Window *pParent, const SfxItemSet &rSet) :
@@ -138,6 +147,8 @@ SwFootNotePage::SwFootNotePage(Window *pParent, const SfxItemSet &rSet) :
aLineTypeBox(this, SW_RES(DLB_LINETYPE)),
aLineWidthLbl(this, SW_RES(FT_LINEWIDTH)),
aLineWidthEdit(this, SW_RES(ED_LINEWIDTH)),
+ aLineColorLbl(this, SW_RES(FT_LINECOLOR)),
+ aLineColorBox(this, SW_RES(DLB_LINECOLOR)),
aLineLengthLbl(this, SW_RES(FT_LINELENGTH)),
aLineLengthEdit(this, SW_RES(ED_LINELENGTH)),
aLineDistLbl(this, SW_RES(FT_LINEDIST)),
@@ -220,6 +231,45 @@ void SwFootNotePage::Reset(const SfxItemSet &rSet)
aLineTypeBox.SetWidth( pFtnInfo->GetLineWidth( ) );
aLineTypeBox.SelectEntry( pFtnInfo->GetLineStyle() );
+ // Separator Color
+ SfxObjectShell* pDocSh = SfxObjectShell::Current();
+ const SfxPoolItem* pColorItem = NULL;
+ XColorTable* pColorTable = NULL;
+
+ DBG_ASSERT( pDocSh, "DocShell not found!" );
+
+ if ( pDocSh )
+ {
+ pColorItem = pDocSh->GetItem( SID_COLOR_TABLE );
+ if ( pColorItem != NULL )
+ pColorTable = ( (SvxColorTableItem*)pColorItem )->GetColorTable();
+ }
+
+ DBG_ASSERT( pColorTable, "ColorTable not found!" );
+
+ if ( pColorTable )
+ {
+ aLineColorBox.SetUpdateMode( sal_False );
+
+ for ( long i = 0; i < pColorTable->Count(); ++i )
+ {
+ XColorEntry* pEntry = pColorTable->GetColor(i);
+ aLineColorBox.InsertEntry( pEntry->GetColor(), pEntry->GetName() );
+ }
+ aLineColorBox.SetUpdateMode( sal_True );
+ }
+
+ // select color in the list or add it as a user color
+ sal_uInt16 nSelPos = aLineColorBox.GetEntryPos( pFtnInfo->GetLineColor() );
+ if( nSelPos == LISTBOX_ENTRY_NOTFOUND )
+ nSelPos = aLineColorBox.InsertEntry( pFtnInfo->GetLineColor(),
+ String( SW_RES( RID_SVXSTR_COLOR_USER ) ) );
+
+ aLineColorBox.SetSelectHdl( LINK( this, SwFootNotePage, LineColorSelected_Impl ) );
+ aLineColorBox.SelectEntryPos( nSelPos );
+ aLineTypeBox.SetColor( pFtnInfo->GetLineColor() );
+
+
// Position
aLinePosBox.SelectEntryPos( static_cast< sal_uInt16 >(pFtnInfo->GetAdj()) );
@@ -269,6 +319,9 @@ sal_Bool SwFootNotePage::FillItemSet(SfxItemSet &rSet)
aLineWidthEdit.GetUnit(), MAP_TWIP );
rFtnInfo.SetLineWidth( nWidth );
+ // Separator color
+ rFtnInfo.SetLineColor( aLineColorBox.GetSelectEntryColor() );
+
// Position
rFtnInfo.SetAdj((SwFtnAdj)aLinePosBox.GetSelectEntryPos());
diff --git a/sw/source/ui/misc/pgfnote.hrc b/sw/source/ui/misc/pgfnote.hrc
index 41ae996..2a69c45 100644
--- a/sw/source/ui/misc/pgfnote.hrc
+++ b/sw/source/ui/misc/pgfnote.hrc
@@ -43,3 +43,5 @@
#define FL_LINE 30
#define FT_LINEWIDTH 31
#define ED_LINEWIDTH 32
+#define FT_LINECOLOR 33
+#define DLB_LINECOLOR 34
diff --git a/sw/source/ui/misc/pgfnote.src b/sw/source/ui/misc/pgfnote.src
index 3d1a162..9b325fe 100644
--- a/sw/source/ui/misc/pgfnote.src
+++ b/sw/source/ui/misc/pgfnote.src
@@ -166,10 +166,28 @@ TabPage TP_FOOTNOTE_PAGE
TabStop = TRUE ;
Left = TRUE ;
};
+ FixedText FT_LINECOLOR
+ {
+ Pos = MAP_APPFONT ( 12 , 121 ) ;
+ Size = MAP_APPFONT ( 132 , 8 ) ;
+ Group = TRUE ;
+ Left = TRUE ;
+ Text [ en-US ] = "~Color" ;
+ };
+ ListBox DLB_LINECOLOR
+ {
+ Pos = MAP_APPFONT ( 148 , 119 ) ;
+ Size = MAP_APPFONT ( 57 , 50 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ DropDown = TRUE ;
+ DDExtraWidth = TRUE ;
+ Border = TRUE ;
+ };
FixedText FT_LINELENGTH
{
- Pos = MAP_APPFONT ( 12 , 121 ) ;
+ Pos = MAP_APPFONT ( 12 , 137 ) ;
Size = MAP_APPFONT ( 132 , 8 ) ;
Left = TRUE ;
Text [ en-US ] = "~Length" ;
@@ -177,7 +195,7 @@ TabPage TP_FOOTNOTE_PAGE
MetricField ED_LINELENGTH
{
Border = TRUE ;
- Pos = MAP_APPFONT ( 148 , 119 ) ;
+ Pos = MAP_APPFONT ( 148 , 135 ) ;
Size = MAP_APPFONT ( 42 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
@@ -192,7 +210,7 @@ TabPage TP_FOOTNOTE_PAGE
};
FixedText FT_LINEDIST
{
- Pos = MAP_APPFONT ( 12 , 137 ) ;
+ Pos = MAP_APPFONT ( 12 , 153 ) ;
Size = MAP_APPFONT ( 132 , 8 ) ;
Text [ en-US ] = "~Spacing to footnote contents" ;
Left = TRUE ;
@@ -201,7 +219,7 @@ TabPage TP_FOOTNOTE_PAGE
{
HelpID = "sw:MetricField:TP_FOOTNOTE_PAGE:ED_LINEDIST";
Border = TRUE ;
- Pos = MAP_APPFONT ( 148 , 135 ) ;
+ Pos = MAP_APPFONT ( 148 , 151 ) ;
Size = MAP_APPFONT ( 42 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
commit 2c4ed299d31f5975977565959e3eff2cb915f80e
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Thu Mar 17 17:40:11 2011 +0100
i#12441: Fixed line style in footnote format GUI and saved it to ODF
diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index cfdcf8a..5afb80a 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -35,6 +35,7 @@
#include <swtypes.hxx> // For SwTwips.
#include <frmfmt.hxx>
#include <editeng/numitem.hxx>
+#include <editeng/borderline.hxx>
class SfxPoolItem;
class SwTxtFmtColl;
@@ -51,18 +52,20 @@ enum SwFtnAdj
// Footnote information.
class SW_DLLPUBLIC SwPageFtnInfo
{
- SwTwips nMaxHeight; // Maximum height of the footnote area.
- sal_uLong nLineWidth; // Width of separator line.
- Color aLineColor; // Color of the separator line.
- Fraction aWidth; // Percentage width of the separator line.
- SwFtnAdj eAdj; // Line adjustment.
- SwTwips nTopDist; // Distance between body and separator.
- SwTwips nBottomDist; // Distance between separator and first footnote.
+ SwTwips nMaxHeight; //maximum height of the footnote area.
+ sal_uLong nLineWidth; //width of separator line
+ SvxBorderStyle eLineStyle; // Style of the separator line
+ Color aLineColor; //color of the separator line
+ Fraction aWidth; //percentage width of the separator line.
+ SwFtnAdj eAdj; //line adjustment.
+ SwTwips nTopDist; //distance between body and separator.
+ SwTwips nBottomDist; //distance between separator and first footnote
public:
SwTwips GetHeight() const { return nMaxHeight; }
sal_uLong GetLineWidth() const { return nLineWidth; }
const Color& GetLineColor() const { return aLineColor;}
+ SvxBorderStyle GetLineStyle() const { return eLineStyle; }
const Fraction& GetWidth() const { return aWidth; }
SwFtnAdj GetAdj() const { return eAdj; }
SwTwips GetTopDist()const { return nTopDist; }
@@ -70,6 +73,7 @@ public:
void SetHeight( SwTwips nNew ) { nMaxHeight = nNew; }
void SetLineWidth(sal_uLong nSet ) { nLineWidth = nSet; }
+ void SetLineStyle( SvxBorderStyle eSet ) { eLineStyle = eSet; }
void SetLineColor(const Color& rCol ) { aLineColor = rCol;}
void SetWidth( const Fraction &rNew){ aWidth = rNew; }
void SetAdj ( SwFtnAdj eNew ) { eAdj = eNew; }
diff --git a/sw/inc/unomid.h b/sw/inc/unomid.h
index 14de6d2..ba22c4c 100644
--- a/sw/inc/unomid.h
+++ b/sw/inc/unomid.h
@@ -118,6 +118,7 @@
#define MID_LINE_ADJUST 4
#define MID_LINE_TEXT_DIST 5
#define MID_LINE_FOOTNOTE_DIST 6
+#define MID_FTN_LINE_STYLE 7
//SwFmtRuby
#define MID_RUBY_TEXT 0
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 7dfee78..2eb894d 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -808,7 +808,8 @@ enum SwPropNameIds
/* 0740 */ UNO_NAME_VBA_DOCOBJ,
/* 0741 */ UNO_NAME_NESTED_TEXT_CONTENT,
/* 0742 */ UNO_NAME_SEPARATOR_LINE_STYLE,
-/* 0743 */ SW_PROPNAME_END
+/* 0743 */ UNO_NAME_FOOTNOTE_LINE_STYLE,
+/* 0744 */ SW_PROPNAME_END
};
struct SwPropNameLen
diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx
index 5ed7b3c..280ba80 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -367,6 +367,7 @@ SwPageFtnInfo::SwPageFtnInfo() :
nMaxHeight( 0 ),
// aPen( PEN_SOLID ),
nLineWidth(10),
+ eLineStyle( SOLID ),
aWidth( 25, 100 ),
nTopDist( 57 ), //1mm
nBottomDist( 57 )
@@ -382,6 +383,7 @@ SwPageFtnInfo::SwPageFtnInfo() :
SwPageFtnInfo::SwPageFtnInfo( const SwPageFtnInfo &rCpy ) :
nMaxHeight( rCpy.GetHeight() ),
nLineWidth(rCpy.nLineWidth),
+ eLineStyle(rCpy.eLineStyle),
aLineColor(rCpy.aLineColor),
aWidth( rCpy.GetWidth() ),
eAdj( rCpy.GetAdj() ),
@@ -402,6 +404,7 @@ SwPageFtnInfo &SwPageFtnInfo::operator=( const SwPageFtnInfo& rCpy )
{
nMaxHeight = rCpy.GetHeight();
nLineWidth = rCpy.nLineWidth;
+ eLineStyle = rCpy.eLineStyle;
aLineColor = rCpy.aLineColor;
aWidth = rCpy.GetWidth();
eAdj = rCpy.GetAdj();
@@ -421,6 +424,7 @@ sal_Bool SwPageFtnInfo::operator==( const SwPageFtnInfo& rCmp ) const
{
return ( nMaxHeight == rCmp.GetHeight() &&
nLineWidth == rCmp.nLineWidth &&
+ eLineStyle == rCmp.eLineStyle &&
aLineColor == rCmp.aLineColor &&
aWidth == rCmp.GetWidth() &&
eAdj == rCmp.GetAdj() &&
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 6f7fdf2..3eb9f60 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4806,7 +4806,8 @@ void SwFtnContFrm::PaintLine( const SwRect& rRect,
: SwRect( Point( nX, Frm().Pos().Y() + rInf.GetTopDist() ),
Size( nWidth, rInf.GetLineWidth()));
if ( aLineRect.HasArea() )
- PaintBorderLine( rRect, aLineRect , pPage, &rInf.GetLineColor() );
+ PaintBorderLine( rRect, aLineRect , pPage, &rInf.GetLineColor(),
+ rInf.GetLineStyle() );
}
/*************************************************************************
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 02c74b6..72a4614 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -838,6 +838,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_FOOTNOTE_HEIGHT), FN_PARAM_FTN_INFO, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE , MID_FTN_HEIGHT|CONVERT_TWIPS},
{ SW_PROP_NMID(UNO_NAME_FOOTNOTE_LINE_WEIGHT), FN_PARAM_FTN_INFO, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE , MID_LINE_WEIGHT|CONVERT_TWIPS},
{ SW_PROP_NMID(UNO_NAME_FOOTNOTE_LINE_COLOR), FN_PARAM_FTN_INFO, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE , MID_LINE_COLOR},
+ { SW_PROP_NMID(UNO_NAME_FOOTNOTE_LINE_STYLE), FN_PARAM_FTN_INFO, CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE , MID_FTN_LINE_STYLE},
{ SW_PROP_NMID(UNO_NAME_FOOTNOTE_LINE_RELATIVE_WIDTH), FN_PARAM_FTN_INFO, CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE , MID_LINE_RELWIDTH },
{ SW_PROP_NMID(UNO_NAME_FOOTNOTE_LINE_ADJUST), FN_PARAM_FTN_INFO, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE , MID_LINE_ADJUST },
{ SW_PROP_NMID(UNO_NAME_FOOTNOTE_LINE_TEXT_DISTANCE), FN_PARAM_FTN_INFO, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE , MID_LINE_TEXT_DIST |CONVERT_TWIPS },
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index 44d8bb3..b6d31f4 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -786,6 +786,7 @@ const SwPropNameTab aPropNameTab = {
/* 0741 UNO_NAME_NESTED_TEXT_CONTENT */ {MAP_CHAR_LEN("NestedTextContent")},
/* 0742 UNO_NAME_SEPARATOR_LINE_STYLE */ {MAP_CHAR_LEN("SeparatorLineStyle")},
+/* 0743 UNO_NAME_FOOTNOTE_LINE_STYLE */ {MAP_CHAR_LEN("FootnoteLineStyle")},
};
const SwPropNameLen& SwGetPropName( sal_uInt16 nId )
diff --git a/sw/source/ui/inc/pgfnote.hxx b/sw/source/ui/inc/pgfnote.hxx
index 810a35b..ac8baa8 100644
--- a/sw/source/ui/inc/pgfnote.hxx
+++ b/sw/source/ui/inc/pgfnote.hxx
@@ -65,14 +65,17 @@ private:
ListBox aLinePosBox;
FixedText aLineTypeLbl;
LineListBox aLineTypeBox;
- FixedText aLineWidthLbl;
- MetricField aLineWidthEdit;
+ FixedText aLineWidthLbl;
+ MetricField aLineWidthEdit;
+ FixedText aLineLengthLbl;
+ MetricField aLineLengthEdit;
FixedText aLineDistLbl;
MetricField aLineDistEdit;
DECL_LINK( HeightPage, Button * );
DECL_LINK( HeightMetric, Button * );
DECL_LINK( HeightModify, MetricField * );
+ DECL_LINK( LineWidthChanged_Impl, void * );
long lMaxHeight;
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index f68ba4d..b95ad34 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -44,6 +44,7 @@
#include <vcl/svapp.hxx>
#include <unotools/localedatawrapper.hxx>
#include <unotools/syslocale.hxx>
+#include <editeng/borderline.hxx>
#include <editeng/sizeitem.hxx>
#include <svx/pageitem.hxx>
#include <svl/eitem.hxx>
@@ -57,41 +58,12 @@
#include <misc.hrc>
#include <pgfnote.hrc>
-#define TWIP_TO_LBOX 5
-
-/*-----------------------------------------------------#---------------
- Beschreibung: vordefinierte Linien in Point
- --------------------------------------------------------------------*/
-static const sal_uInt16 nLines[] = {
- 0,
- 50,
- 100,
- 150,
- 200,
- 500
-};
-
-static const sal_uInt16 nLineCount = SAL_N_ELEMENTS(nLines);
-
static sal_uInt16 aPageRg[] = {
FN_PARAM_FTN_INFO, FN_PARAM_FTN_INFO,
0
};
/*------------------------------------------------------------------------
- Beschreibung: liefert zurueck, ob die Linienbreite nWidth bereits
- in der Listbox enthalten ist.
-------------------------------------------------------------------------*/
-sal_Bool lcl_HasLineWidth(sal_uInt16 nWidth)
-{
- for(sal_uInt16 i = 0; i < nLineCount; ++i) {
- if(nLines[i] == nWidth)
- return sal_True;
- }
- return sal_False;
-}
-
-/*------------------------------------------------------------------------
Beschreibung: Handler fuer umschalten zwischen den unterschiedlichen
Arten, wie die Hoehe des Fussnotenbereiches angegeben
werden kann.
@@ -136,6 +108,17 @@ IMPL_LINK( SwFootNotePage, HeightModify, MetricField *, EMPTYARG )
return 0;
}
+IMPL_LINK( SwFootNotePage, LineWidthChanged_Impl, void *, EMPTYARG )
+{
+ sal_Int64 nVal = MetricField::ConvertDoubleValue(
+ aLineWidthEdit.GetValue( ),
+ aLineWidthEdit.GetDecimalDigits( ),
+ aLineWidthEdit.GetUnit(), MAP_TWIP );
+ aLineTypeBox.SetWidth( nVal );
+
+ return 0;
+}
+
// CTOR / DTOR -----------------------------------------------------------
SwFootNotePage::SwFootNotePage(Window *pParent, const SfxItemSet &rSet) :
@@ -153,8 +136,10 @@ SwFootNotePage::SwFootNotePage(Window *pParent, const SfxItemSet &rSet) :
aLinePosBox(this, SW_RES(DLB_LINEPOS)),
aLineTypeLbl(this, SW_RES(FT_LINETYPE)),
aLineTypeBox(this, SW_RES(DLB_LINETYPE)),
- aLineWidthLbl(this, SW_RES(FT_LINEWIDTH)),
- aLineWidthEdit(this, SW_RES(ED_LINEWIDTH)),
+ aLineWidthLbl(this, SW_RES(FT_LINEWIDTH)),
+ aLineWidthEdit(this, SW_RES(ED_LINEWIDTH)),
+ aLineLengthLbl(this, SW_RES(FT_LINELENGTH)),
+ aLineLengthEdit(this, SW_RES(ED_LINELENGTH)),
aLineDistLbl(this, SW_RES(FT_LINEDIST)),
aLineDistEdit(this, SW_RES(ED_LINEDIST))
{
@@ -217,14 +202,23 @@ void SwFootNotePage::Reset(const SfxItemSet &rSet)
aDistEdit.SetLoseFocusHdl( aLk );
aLineDistEdit.SetLoseFocusHdl( aLk );
- // Trennlinie
- for(sal_uInt16 i = 0; i < nLineCount; ++i)
- aLineTypeBox.InsertEntry(nLines[i]);
+ // Separator width
+ aLineWidthEdit.SetModifyHdl( LINK( this, SwFootNotePage, LineWidthChanged_Impl ) );
+
+ sal_Int64 nWidthPt = MetricField::ConvertDoubleValue(
+ sal_Int64( pFtnInfo->GetLineWidth() ), aLineWidthEdit.GetDecimalDigits(),
+ MAP_TWIP, aLineWidthEdit.GetUnit( ) );
+ aLineWidthEdit.SetValue( nWidthPt );
- const sal_uInt16 nWidth = (sal_uInt16)pFtnInfo->GetLineWidth() * TWIP_TO_LBOX;
- if ( !lcl_HasLineWidth(nWidth) )
- aLineTypeBox.InsertEntry(nWidth);
- aLineTypeBox.SelectEntry(nWidth);
+ // Separator style
+ aLineTypeBox.SetSourceUnit( FUNIT_TWIP );
+
+ aLineTypeBox.SetNone( String( SW_RES( STR_NONE ) ) );
+ aLineTypeBox.InsertEntry( SvxBorderLine::getWidthImpl( SOLID ), SOLID );
+ aLineTypeBox.InsertEntry( SvxBorderLine::getWidthImpl( DOTTED ), DOTTED );
+ aLineTypeBox.InsertEntry( SvxBorderLine::getWidthImpl( DASHED ), DASHED );
+ aLineTypeBox.SetWidth( pFtnInfo->GetLineWidth( ) );
+ aLineTypeBox.SelectEntry( pFtnInfo->GetLineStyle() );
// Position
aLinePosBox.SelectEntryPos( static_cast< sal_uInt16 >(pFtnInfo->GetAdj()) );
@@ -232,7 +226,7 @@ void SwFootNotePage::Reset(const SfxItemSet &rSet)
// Breite
Fraction aTmp( 100, 1 );
aTmp *= pFtnInfo->GetWidth();
- aLineWidthEdit.SetValue( static_cast<long>(aTmp) );
+ aLineLengthEdit.SetValue( static_cast<long>(aTmp) );
// Abstand Fussnotenbereich
aDistEdit.SetValue(aDistEdit.Normalize(pFtnInfo->GetTopDist()),FUNIT_TWIP);
@@ -265,16 +259,21 @@ sal_Bool SwFootNotePage::FillItemSet(SfxItemSet &rSet)
rFtnInfo.SetBottomDist( static_cast< SwTwips >(
aLineDistEdit.Denormalize(aLineDistEdit.GetValue(FUNIT_TWIP))));
- // Trennlinie
- const sal_uInt16 nPos = aLineTypeBox.GetSelectEntryPos();
- if( LISTBOX_ENTRY_NOTFOUND != nPos )
- rFtnInfo.SetLineWidth(nLines[nPos] / TWIP_TO_LBOX);
+ // Separator style
+ rFtnInfo.SetLineStyle( SvxBorderStyle( aLineTypeBox.GetSelectEntryStyle() ) );
+
+ // Separator width
+ long nWidth = MetricField::ConvertDoubleValue(
+ aLineWidthEdit.GetValue( ),
+ aLineWidthEdit.GetDecimalDigits( ),
+ aLineWidthEdit.GetUnit(), MAP_TWIP );
+ rFtnInfo.SetLineWidth( nWidth );
// Position
rFtnInfo.SetAdj((SwFtnAdj)aLinePosBox.GetSelectEntryPos());
// Breite
- rFtnInfo.SetWidth(Fraction( static_cast< long >(aLineWidthEdit.GetValue()), 100));
+ rFtnInfo.SetWidth(Fraction( static_cast< long >(aLineLengthEdit.GetValue()), 100));
const SfxPoolItem* pOldItem;
if(0 == (pOldItem = GetOldItem( rSet, FN_PARAM_FTN_INFO )) ||
diff --git a/sw/source/ui/misc/pgfnote.hrc b/sw/source/ui/misc/pgfnote.hrc
index c213f29..41ae996 100644
--- a/sw/source/ui/misc/pgfnote.hrc
+++ b/sw/source/ui/misc/pgfnote.hrc
@@ -36,9 +36,10 @@
#define DLB_LINETYPE 21
#define FT_LINEPOS 22
#define DLB_LINEPOS 23
-#define FT_LINEWIDTH 24
-#define ED_LINEWIDTH 25
+#define FT_LINELENGTH 24
+#define ED_LINELENGTH 25
#define FT_LINEDIST 26
#define ED_LINEDIST 27
#define FL_LINE 30
-
+#define FT_LINEWIDTH 31
+#define ED_LINEWIDTH 32
diff --git a/sw/source/ui/misc/pgfnote.src b/sw/source/ui/misc/pgfnote.src
index eebc13c..3d1a162 100644
--- a/sw/source/ui/misc/pgfnote.src
+++ b/sw/source/ui/misc/pgfnote.src
@@ -129,7 +129,7 @@ TabPage TP_FOOTNOTE_PAGE
Size = MAP_APPFONT ( 132 , 8 ) ;
Group = TRUE ;
Left = TRUE ;
- Text [ en-US ] = "~Weight" ;
+ Text [ en-US ] = "~Style" ;
};
ListBox DLB_LINETYPE
{
@@ -139,15 +139,14 @@ TabPage TP_FOOTNOTE_PAGE
TabStop = TRUE ;
Group = TRUE ;
DropDown = TRUE ;
- CurPos = 0 ;
};
-
FixedText FT_LINEWIDTH
{
Pos = MAP_APPFONT ( 12 , 105 ) ;
Size = MAP_APPFONT ( 132 , 8 ) ;
+ Group = TRUE ;
Left = TRUE ;
- Text [ en-US ] = "~Length" ;
+ Text [ en-US ] = "~Thickness" ;
};
MetricField ED_LINEWIDTH
{
@@ -155,6 +154,31 @@ TabPage TP_FOOTNOTE_PAGE
Border = TRUE ;
Pos = MAP_APPFONT ( 148 , 103 ) ;
Size = MAP_APPFONT ( 42 , 12 ) ;
+ Spin = TRUE ;
+ Repeat = TRUE ;
+ SpinSize = 25 ;
+ First = 25 ;
+ Last = 900 ;
+ Maximum = 900 ;
+ Minimum = 25 ;
+ DecimalDigits = 2 ;
+ Unit = FUNIT_POINT ;
+ TabStop = TRUE ;
+ Left = TRUE ;
+ };
+
+ FixedText FT_LINELENGTH
+ {
+ Pos = MAP_APPFONT ( 12 , 121 ) ;
+ Size = MAP_APPFONT ( 132 , 8 ) ;
+ Left = TRUE ;
+ Text [ en-US ] = "~Length" ;
+ };
+ MetricField ED_LINELENGTH
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 148 , 119 ) ;
+ Size = MAP_APPFONT ( 42 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
Repeat = TRUE ;
@@ -168,7 +192,7 @@ TabPage TP_FOOTNOTE_PAGE
};
FixedText FT_LINEDIST
{
- Pos = MAP_APPFONT ( 12 , 121 ) ;
+ Pos = MAP_APPFONT ( 12 , 137 ) ;
Size = MAP_APPFONT ( 132 , 8 ) ;
Text [ en-US ] = "~Spacing to footnote contents" ;
Left = TRUE ;
@@ -177,7 +201,7 @@ TabPage TP_FOOTNOTE_PAGE
{
HelpID = "sw:MetricField:TP_FOOTNOTE_PAGE:ED_LINEDIST";
Border = TRUE ;
- Pos = MAP_APPFONT ( 148 , 119 ) ;
+ Pos = MAP_APPFONT ( 148 , 135 ) ;
Size = MAP_APPFONT ( 42 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
diff --git a/sw/source/ui/utlui/uiitems.cxx b/sw/source/ui/utlui/uiitems.cxx
index 87a8045..3a1cd8f 100644
--- a/sw/source/ui/utlui/uiitems.cxx
+++ b/sw/source/ui/utlui/uiitems.cxx
@@ -140,6 +140,18 @@ bool SwPageFtnInfoItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const
case MID_LINE_ADJUST : rVal <<= (sal_Int16)aFtnInfo.GetAdj();break;//text::HorizontalAdjust
case MID_LINE_TEXT_DIST : rVal <<= (sal_Int32)TWIP_TO_MM100(aFtnInfo.GetTopDist());break;
case MID_LINE_FOOTNOTE_DIST: rVal <<= (sal_Int32)TWIP_TO_MM100(aFtnInfo.GetBottomDist());break;
+ case MID_FTN_LINE_STYLE :
+ {
+ switch ( aFtnInfo.GetLineStyle( ) )
+ {
+ default:
+ case NO_STYLE: rVal <<= sal_Int8( 0 ); break;
+ case SOLID: rVal <<= sal_Int8( 1 ); break;
+ case DOTTED: rVal <<= sal_Int8( 2 ); break;
+ case DASHED: rVal <<= sal_Int8( 3 ); break;
+ }
+ break;
+ }
default:
bRet = false;
}
@@ -202,6 +214,20 @@ bool SwPageFtnInfoItem::PutValue(const Any& rVal, sal_uInt8 nMemberId)
else
bRet = false;
}
+ case MID_FTN_LINE_STYLE:
+ {
+ SvxBorderStyle eStyle = NO_STYLE;
+ sal_Int8 nSet = 0;
+ rVal >>= nSet;
+ switch ( nSet )
+ {
+ case 1: eStyle = SOLID; break;
+ case 2: eStyle = DOTTED; break;
+ case 3: eStyle = DASHED; break;
+ default: break;
+ }
+ aFtnInfo.SetLineStyle( eStyle );
+ }
break;
default:
bRet = false;
commit 0c6cfff9d2e5f03470badb65340533e521ca9364
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Wed Mar 16 16:06:49 2011 +0100
Added column separator style in ODF
diff --git a/sw/inc/unomap.hxx b/sw/inc/unomap.hxx
index 8390b47..ba373c9 100644
--- a/sw/inc/unomap.hxx
+++ b/sw/inc/unomap.hxx
@@ -316,6 +316,7 @@
#define WID_TXTCOL_LINE_IS_ON 4
#define WID_TXTCOL_IS_AUTOMATIC 5
#define WID_TXTCOL_AUTO_DISTANCE 6
+#define WID_TXTCOL_LINE_STYLE 7
class SwItemPropertySet : public SfxItemPropertySet
{
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 837f361..7dfee78 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -807,7 +807,8 @@ enum SwPropNameIds
/* 0739 */ UNO_NAME_IS_TEMPLATE,
/* 0740 */ UNO_NAME_VBA_DOCOBJ,
/* 0741 */ UNO_NAME_NESTED_TEXT_CONTENT,
-/* 0742 */ SW_PROPNAME_END
+/* 0742 */ UNO_NAME_SEPARATOR_LINE_STYLE,
+/* 0743 */ SW_PROPNAME_END
};
struct SwPropNameLen
diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx
index 6c7f2f7..d4cde31 100644
--- a/sw/inc/unosett.hxx
+++ b/sw/inc/unosett.hxx
@@ -262,6 +262,8 @@ class SwXTextColumns : public cppu::WeakAggImplHelper4
sal_Int8 nSepLineHeightRelative;
sal_Int8 nSepLineVertAlign;//style::VerticalAlignment
sal_Bool bSepLineIsOn;
+ sal_Int8 nSepLineStyle;
+
protected:
virtual ~SwXTextColumns();
public:
@@ -301,6 +303,7 @@ public:
sal_Int8 GetSepLineHeightRelative() const {return nSepLineHeightRelative;}
sal_Int8 GetSepLineVertAlign() const {return nSepLineVertAlign;}
sal_Bool GetSepLineIsOn() const {return bSepLineIsOn;}
+ sal_Int8 GetSepLineStyle() const {return nSepLineStyle;}
sal_Bool IsAutomaticWidth() const {return bIsAutomaticWidth;}
};
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index e4fc765..e533e36 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -1071,6 +1071,14 @@ bool SwFmtCol::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
nLineWidth = pSwColums->GetSepLineWidth();
aLineColor.SetColor(pSwColums->GetSepLineColor());
nLineHeight = pSwColums->GetSepLineHeightRelative();
+ switch ( pSwColums->GetSepLineStyle() )
+ {
+ default:
+ case 0: eLineStyle = NO_STYLE; break;
+ case 1: eLineStyle = SOLID; break;
+ case 2: eLineStyle = DOTTED; break;
+ case 3: eLineStyle = DASHED; break;
+ }
if(!pSwColums->GetSepLineIsOn())
eAdj = COLADJ_NONE;
else switch(pSwColums->GetSepLineVertAlign())
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index e1b3713..02c74b6 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -1613,6 +1613,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{SW_PROP_NMID(UNO_NAME_SEPARATOR_LINE_RELATIVE_HEIGHT), WID_TXTCOL_LINE_REL_HGT, CPPU_E2T(CPPUTYPE_INT32),PROPERTY_NONE, 0},
{SW_PROP_NMID(UNO_NAME_SEPARATOR_LINE_VERTIVAL_ALIGNMENT), WID_TXTCOL_LINE_ALIGN, CPPU_E2T(CPPUTYPE_VERTALIGN),PROPERTY_NONE, 0},
{SW_PROP_NMID(UNO_NAME_SEPARATOR_LINE_IS_ON), WID_TXTCOL_LINE_IS_ON, CPPU_E2T(CPPUTYPE_BOOLEAN),PROPERTY_NONE, 0},
+ {SW_PROP_NMID(UNO_NAME_SEPARATOR_LINE_STYLE), WID_TXTCOL_LINE_STYLE, CPPU_E2T(CPPUTYPE_INT8),PROPERTY_NONE, 0},
{0,0,0,0,0,0}
};
aMapEntriesArr[nPropertyId] = aTextColumns_Impl;
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index 2eef749..44d8bb3 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -785,6 +785,7 @@ const SwPropNameTab aPropNameTab = {
/* 0740 UNO_NAME_VBA_DOCOBJ */ {MAP_CHAR_LEN("ThisVBADocObj")},
/* 0741 UNO_NAME_NESTED_TEXT_CONTENT */ {MAP_CHAR_LEN("NestedTextContent")},
+/* 0742 UNO_NAME_SEPARATOR_LINE_STYLE */ {MAP_CHAR_LEN("SeparatorLineStyle")},
};
const SwPropNameLen& SwGetPropName( sal_uInt16 nId )
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 21c337c..593db07 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -100,6 +100,12 @@ struct PropValData
{}
};
+// Constants for the css::text::ColumnSeparatorStyle
+#define API_COL_LINE_NONE 0
+#define API_COL_LINE_SOLID 1
+#define API_COL_LINE_DOTTED 2
+#define API_COL_LINE_DASHED 3
+
typedef PropValData* PropValDataPtr;
SV_DECL_PTRARR(PropValDataArr, PropValDataPtr, 5, 5 )
SV_IMPL_PTRARR(PropValDataArr, PropValDataPtr)
@@ -2354,7 +2360,8 @@ SwXTextColumns::SwXTextColumns(sal_uInt16 nColCount) :
nSepLineColor(0), //black
nSepLineHeightRelative(100),//full height
nSepLineVertAlign(style::VerticalAlignment_MIDDLE),
- bSepLineIsOn(sal_False)
+ bSepLineIsOn(sal_False),
+ nSepLineStyle(API_COL_LINE_NONE) // None
{
if(nColCount)
setColumnCount(nColCount);
@@ -2390,6 +2397,15 @@ SwXTextColumns::SwXTextColumns(const SwFmtCol& rFmtCol) :
nSepLineColor = rFmtCol.GetLineColor().GetColor();
nSepLineHeightRelative = rFmtCol.GetLineHeight();
bSepLineIsOn = rFmtCol.GetLineAdj() != COLADJ_NONE;
+ sal_Int8 nStyle = API_COL_LINE_NONE;
+ switch (rFmtCol.GetLineStyle())
+ {
+ case SOLID: nStyle = API_COL_LINE_SOLID; break;
+ case DOTTED: nStyle = API_COL_LINE_DOTTED; break;
+ case DASHED: nStyle = API_COL_LINE_DASHED; break;
+ default: break;
+ }
+ nSepLineStyle = nStyle;
switch(rFmtCol.GetLineAdj())
{
case COLADJ_TOP: nSepLineVertAlign = style::VerticalAlignment_TOP; break;
@@ -2488,6 +2504,11 @@ void SwXTextColumns::setPropertyValue( const OUString& rPropertyName, const Any&
case WID_TXTCOL_LINE_COLOR:
aValue >>= nSepLineColor;
break;
+ case WID_TXTCOL_LINE_STYLE:
+ {
+ aValue >>= nSepLineStyle;
+ }
+ break;
case WID_TXTCOL_LINE_REL_HGT:
{
sal_Int8 nTmp = 0;
@@ -2551,6 +2572,9 @@ Any SwXTextColumns::getPropertyValue( const OUString& rPropertyName )
case WID_TXTCOL_LINE_COLOR:
aRet <<= nSepLineColor;
break;
+ case WID_TXTCOL_LINE_STYLE:
+ aRet <<= nSepLineStyle;
+ break;
case WID_TXTCOL_LINE_REL_HGT:
aRet <<= nSepLineHeightRelative;
break;
commit b8dc9994f9e3357c44dff764439104f7bab94589
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Mon Mar 14 15:22:00 2011 +0100
Fixed the NONE border line style API value
diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx
index 0844ae1..f3795e9 100644
--- a/sw/source/filter/xml/xmlithlp.cxx
+++ b/sw/source/filter/xml/xmlithlp.cxx
@@ -51,7 +51,7 @@ using namespace ::xmloff::token;
using namespace ::com::sun::star;
-#define API_LINE_NONE -1
+#define API_LINE_NONE 0x7FFF
#define API_LINE_SOLID 0
#define API_LINE_DOTTED 1
#define API_LINE_DASHED 2
commit 70d185a2dbac2aa3a24c2837086939ed450f68e1
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Tue Feb 22 07:34:38 2011 +0100
Shift all table border lines in sw to avoid hacky clipping of the borders
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 87426a8..6f7fdf2 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2601,6 +2601,8 @@ void SwTabFrmPainter::Insert( const SwFrm& rFrm, const SvxBoxItem& rBoxItem )
svx::frame::Style aT( rBoxItem.GetTop() );
svx::frame::Style aB( rBoxItem.GetBottom() );
+ const SwTwips nHalfTopWidth = aT.GetWidth() / 2;
+
aR.MirrorSelf();
aB.MirrorSelf();
@@ -2612,10 +2614,10 @@ void SwTabFrmPainter::Insert( const SwFrm& rFrm, const SvxBoxItem& rBoxItem )
aT.SetRefMode( !bVert ? svx::frame::REFMODE_BEGIN : svx::frame::REFMODE_END );
aB.SetRefMode( !bVert ? svx::frame::REFMODE_BEGIN : svx::frame::REFMODE_END );
- SwLineEntry aLeft ( nLeft, nTop, nBottom, bVert ? aB : ( bR2L ? aR : aL ) );
- SwLineEntry aRight ( nRight, nTop, nBottom, bVert ? aT : ( bR2L ? aL : aR ) );
- SwLineEntry aTop ( nTop, nLeft, nRight, bVert ? aL : aT );
- SwLineEntry aBottom( nBottom, nLeft, nRight, bVert ? aR : aB );
+ SwLineEntry aLeft ( nLeft, nTop + nHalfTopWidth, nBottom + nHalfTopWidth, bVert ? aB : ( bR2L ? aR : aL ) );
+ SwLineEntry aRight ( nRight, nTop + nHalfTopWidth, nBottom + nHalfTopWidth, bVert ? aT : ( bR2L ? aL : aR ) );
+ SwLineEntry aTop ( nTop + nHalfTopWidth, nLeft, nRight, bVert ? aL : aT );
+ SwLineEntry aBottom( nBottom + nHalfTopWidth, nLeft, nRight, bVert ? aR : aB );
Insert( aLeft, false );
Insert( aRight, false );
commit f5e6fceefc847a078cba2d5e15b96118b4de989c
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Fri Feb 18 16:02:34 2011 +0100
ODT import filter fixed for the new borders
diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx
index 6af9cfc..0844ae1 100644
--- a/sw/source/filter/xml/xmlithlp.cxx
+++ b/sw/source/filter/xml/xmlithlp.cxx
@@ -51,7 +51,7 @@ using namespace ::xmloff::token;
using namespace ::com::sun::star;
-#define API_LINE_NONE USHRT_MAX
+#define API_LINE_NONE -1
#define API_LINE_SOLID 0
#define API_LINE_DOTTED 1
#define API_LINE_DASHED 2
@@ -166,7 +166,7 @@ sal_Bool lcl_frmitems_setXMLBorder( SvxBorderLine*& rpLine,
sal_Bool bHasColor, const Color& rColor )
{
// first of all, delete an empty line
- if( (bHasStyle && SVX_XML_BORDER_STYLE_NONE == nStyle) ||
+ if( (bHasStyle && API_LINE_NONE == nStyle) ||
(bHasWidth && USHRT_MAX == nNamedWidth && 0 == nWidth) )
{
sal_Bool bRet = 0 != rpLine;
@@ -191,10 +191,10 @@ sal_Bool lcl_frmitems_setXMLBorder( SvxBorderLine*& rpLine,
if( ( bHasWidth &&
(USHRT_MAX != nNamedWidth || (nWidth != rpLine->GetWidth() ) ) ) ||
( bHasStyle &&
- ((SVX_XML_BORDER_STYLE_SOLID == nStyle && rpLine->GetDistance()) ||
- (SVX_XML_BORDER_STYLE_DOUBLE == nStyle && !rpLine->GetDistance())) ) )
+ ((API_LINE_SOLID == nStyle && rpLine->GetDistance()) ||
+ (API_LINE_DOUBLE == nStyle && !rpLine->GetDistance())) ) )
{
- sal_Bool bDouble = (bHasWidth && SVX_XML_BORDER_STYLE_DOUBLE == nStyle ) ||
+ sal_Bool bDouble = (bHasWidth && API_LINE_DOUBLE == nStyle ) ||
rpLine->GetDistance();
// The width has to be changed
commit bbda1d8160666a93b0072ab6f2154f3ecd7d24f8
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Fri Feb 18 10:47:58 2011 +0100
Docx export filter: fixed wrong embossed/engraved values
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 94bdd3a..519f7bf 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1352,6 +1352,7 @@ static void impl_borderLine( FSHelperPtr pSerializer, sal_Int32 elementToken, co
{
FastAttributeList* pAttr = pSerializer->createAttrList();
+
// Compute val attribute value
// Can be one of:
// single, double,
@@ -1360,76 +1361,83 @@ static void impl_borderLine( FSHelperPtr pSerializer, sal_Int32 elementToken, co
// thickThinMediumGap, thickThinLargeGap, thickThinSmallGap
// thinThickLargeGap, thinThickMediumGap, thinThickSmallGap
const char* pVal = "none";
- switch ( pBorderLine->GetStyle( ) )
+ if ( !pBorderLine->isEmpty( ) )
{
- case SOLID:
- pVal = ( sal_Char* )"single";
- case DOTTED:
- pVal = ( sal_Char* )"dotted";
- break;
- case DASHED:
- pVal = ( sal_Char* )"dashed";
- break;
- case DOUBLE:
- pVal = ( sal_Char* )"double";
- break;
- case THINTHICK_SMALLGAP:
- pVal = ( sal_Char* )"thinThickSmallGap";
- break;
- case THINTHICK_MEDIUMGAP:
- pVal = ( sal_Char* )"thinThickMediumGap";
- break;
- case THINTHICK_LARGEGAP:
- pVal = ( sal_Char* )"thinThickLargeGap";
- break;
- case THICKTHIN_SMALLGAP:
- pVal = ( sal_Char* )"thickThinSmallGap";
- break;
- case THICKTHIN_MEDIUMGAP:
- pVal = ( sal_Char* )"thickThinMediumGap";
- break;
- case THICKTHIN_LARGEGAP:
- pVal = ( sal_Char* )"thickThinLargeGap";
- break;
- case EMBOSSED:
- pVal = ( sal_Char* )"embossed";
- break;
- case ENGRAVED:
- pVal = ( sal_Char* )"engraved";
- break;
- case OUTSET:
- pVal = ( sal_Char* )"outset";
- break;
- case INSET:
- pVal = ( sal_Char* )"inset";
- break;
- case NO_STYLE:
- default:
- break;
+ switch ( pBorderLine->GetStyle( ) )
+ {
+ case SOLID:
+ pVal = ( sal_Char* )"single";
+ break;
+ case DOTTED:
+ pVal = ( sal_Char* )"dotted";
+ break;
+ case DASHED:
+ pVal = ( sal_Char* )"dashed";
+ break;
+ case DOUBLE:
+ pVal = ( sal_Char* )"double";
+ break;
+ case THINTHICK_SMALLGAP:
+ pVal = ( sal_Char* )"thinThickSmallGap";
+ break;
+ case THINTHICK_MEDIUMGAP:
+ pVal = ( sal_Char* )"thinThickMediumGap";
+ break;
+ case THINTHICK_LARGEGAP:
+ pVal = ( sal_Char* )"thinThickLargeGap";
+ break;
+ case THICKTHIN_SMALLGAP:
+ pVal = ( sal_Char* )"thickThinSmallGap";
+ break;
+ case THICKTHIN_MEDIUMGAP:
+ pVal = ( sal_Char* )"thickThinMediumGap";
+ break;
+ case THICKTHIN_LARGEGAP:
+ pVal = ( sal_Char* )"thickThinLargeGap";
+ break;
+ case EMBOSSED:
+ pVal = ( sal_Char* )"threeDEmboss";
+ break;
+ case ENGRAVED:
+ pVal = ( sal_Char* )"threeDEngrave";
+ break;
+ case OUTSET:
+ pVal = ( sal_Char* )"outset";
+ break;
+ case INSET:
+ pVal = ( sal_Char* )"inset";
+ break;
+ case NO_STYLE:
+ default:
+ break;
+ }
}
pAttr->add( FSNS( XML_w, XML_val ), OString( pVal ) );
- // Compute the sz attribute
+ if ( !pBorderLine->isEmpty() )
+ {
+ // Compute the sz attribute
- // The unit is the 8th of point
- sal_Int32 nWidth = sal_Int32( pBorderLine->GetWidth() / 2.5 );
- sal_uInt16 nMinWidth = 2;
- sal_uInt16 nMaxWidth = 96;
+ // The unit is the 8th of point
+ sal_Int32 nWidth = sal_Int32( pBorderLine->GetWidth() / 2.5 );
+ sal_uInt16 nMinWidth = 2;
+ sal_uInt16 nMaxWidth = 96;
- if ( nWidth > nMaxWidth )
- nWidth = nMaxWidth;
- else if ( nWidth < nMinWidth )
- nWidth = nMinWidth;
+ if ( nWidth > nMaxWidth )
+ nWidth = nMaxWidth;
+ else if ( nWidth < nMinWidth )
+ nWidth = nMinWidth;
- pAttr->add( FSNS( XML_w, XML_sz ), OString::valueOf( sal_Int32( nWidth ) ) );
+ pAttr->add( FSNS( XML_w, XML_sz ), OString::valueOf( sal_Int32( nWidth ) ) );
- // Get the distance (in pt)
- pAttr->add( FSNS( XML_w, XML_space ), OString::valueOf( sal_Int32( nDist / 20 ) ) );
+ // Get the distance (in pt)
+ pAttr->add( FSNS( XML_w, XML_space ), OString::valueOf( sal_Int32( nDist / 20 ) ) );
- // Get the color code as an RRGGBB hex value
- OString sColor( impl_ConvertColor( pBorderLine->GetColor( ) ) );
- pAttr->add( FSNS( XML_w, XML_color ), sColor );
+ // Get the color code as an RRGGBB hex value
+ OString sColor( impl_ConvertColor( pBorderLine->GetColor( ) ) );
+ pAttr->add( FSNS( XML_w, XML_color ), sColor );
+ }
XFastAttributeListRef xAttrs( pAttr );
pSerializer->singleElementNS( XML_w, elementToken, xAttrs );
commit dfca82dd492a76b277c2af339ba89566397ee1cb
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Fri Feb 18 09:56:56 2011 +0100
Fixed HTML filters to work with new borders
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index ed655c2..4a435be 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -3533,20 +3533,13 @@ static void OutCSS1_SvxBorderLine( SwHTMLWriter& rHTMLWrt,
const sal_Char *pProperty,
const SvxBorderLine *pLine )
{
- if( !pLine )
+ if( !pLine || pLine->isEmpty() )
{
rHTMLWrt.OutCSS1_PropertyAscii( pProperty, sCSS1_PV_none );
return;
}
- sal_Bool bDouble = sal_False;
- sal_Int32 nWidth = pLine->GetOutWidth();
- if( pLine->GetInWidth() )
- {
- nWidth += pLine->GetDistance();
- nWidth += pLine->GetInWidth();
- bDouble = sal_True;
- }
+ sal_Int32 nWidth = pLine->GetWidth();
ByteString sOut;
if( Application::GetDefaultDevice() &&
@@ -3570,21 +3563,40 @@ static void OutCSS1_SvxBorderLine( SwHTMLWriter& rHTMLWrt,
// Linien-Stil: solid oder double
sOut += ' ';
- if ( bDouble )
- sOut += sCSS1_PV_double;
- else
+ switch ( pLine->GetStyle( ) )
{
- switch ( pLine->GetStyle( ) )
- {
- case DOTTED:
- sOut += sCSS1_PV_dotted;
- break;
- case DASHED:
- sOut += sCSS1_PV_dashed;
- break;
- default:
- sOut += sCSS1_PV_solid;
- }
+ case SOLID:
+ sOut += sCSS1_PV_solid;
+ break;
+ case DOTTED:
+ sOut += sCSS1_PV_dotted;
+ break;
+ case DASHED:
+ sOut += sCSS1_PV_dashed;
+ break;
+ case DOUBLE:
+ case THINTHICK_SMALLGAP:
+ case THINTHICK_MEDIUMGAP:
+ case THINTHICK_LARGEGAP:
+ case THICKTHIN_SMALLGAP:
+ case THICKTHIN_MEDIUMGAP:
+ case THICKTHIN_LARGEGAP:
+ sOut += sCSS1_PV_double;
+ break;
+ case EMBOSSED:
+ sOut += sCSS1_PV_ridge;
+ break;
+ case ENGRAVED:
+ sOut += sCSS1_PV_groove;
+ break;
+ case INSET:
+ sOut += sCSS1_PV_inset;
+ break;
+ case OUTSET:
+ sOut += sCSS1_PV_outset;
+ break;
+ default:
+ sOut += sCSS1_PV_none;
}
sOut += ' ';
diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx
index 5493ad2..6c097aa 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -184,7 +184,7 @@ static CSS1PropertyEnum const aBorderWidthTable[] =
{ 0, 0 }
};
-enum CSS1BorderStyle { CSS1_BS_NONE, CSS1_BS_SINGLE, CSS1_BS_DOUBLE, CSS1_BS_DOTTED, CSS1_BS_DASHED };
+enum CSS1BorderStyle { CSS1_BS_NONE, CSS1_BS_SINGLE, CSS1_BS_DOUBLE, CSS1_BS_DOTTED, CSS1_BS_DASHED, CSS1_BS_GROOVE, CSS1_BS_RIDGE, CSS1_BS_INSET, CSS1_BS_OUTSET };
static CSS1PropertyEnum const aBorderStyleTable[] =
{
@@ -193,10 +193,10 @@ static CSS1PropertyEnum const aBorderStyleTable[] =
{ sCSS1_PV_dashed, CSS1_BS_DASHED },
{ sCSS1_PV_solid, CSS1_BS_SINGLE },
{ sCSS1_PV_double, CSS1_BS_DOUBLE },
- { sCSS1_PV_groove, CSS1_BS_SINGLE },
- { sCSS1_PV_ridge, CSS1_BS_SINGLE },
- { sCSS1_PV_inset, CSS1_BS_SINGLE },
- { sCSS1_PV_outset, CSS1_BS_SINGLE },
+ { sCSS1_PV_groove, CSS1_BS_GROOVE },
+ { sCSS1_PV_ridge, CSS1_BS_RIDGE },
+ { sCSS1_PV_inset, CSS1_BS_INSET },
+ { sCSS1_PV_outset, CSS1_BS_OUTSET },
{ 0, 0 }
};
@@ -328,14 +328,36 @@ void SvxCSS1BorderInfo::SetBorderLine( sal_uInt16 nLine, SvxBoxItem &rBoxItem )
SvxBorderLine aBorderLine( &aColor );
// Linien-Stil doppelt oder einfach?
- if ( eStyle == CSS1_BS_DOTTED )
- aBorderLine.SetStyle( DOTTED );
- else if ( eStyle == CSS1_BS_DASHED )
- aBorderLine.SetStyle( DASHED );
- else if ( eStyle == CSS1_BS_DOUBLE )
- aBorderLine.SetStyle( DOUBLE );
- else
- aBorderLine.SetStyle( SOLID );
+ switch ( eStyle )
+ {
+ case CSS1_BS_SINGLE:
+ aBorderLine.SetStyle( SOLID );
+ break;
+ case CSS1_BS_DOUBLE:
+ aBorderLine.SetStyle( DOUBLE );
+ break;
+ case CSS1_BS_DOTTED:
+ aBorderLine.SetStyle( DOTTED );
+ break;
+ case CSS1_BS_DASHED:
+ aBorderLine.SetStyle( DASHED );
+ break;
+ case CSS1_BS_GROOVE:
+ aBorderLine.SetStyle( ENGRAVED );
+ break;
+ case CSS1_BS_RIDGE:
+ aBorderLine.SetStyle( EMBOSSED );
+ break;
+ case CSS1_BS_INSET:
+ aBorderLine.SetStyle( INSET );
+ break;
+ case CSS1_BS_OUTSET:
+ aBorderLine.SetStyle( OUTSET );
+ break;
+ default:
+ aBorderLine.SetStyle( NO_STYLE );
+ break;
+ }
// benannte Breite umrechnenen, wenn keine absolute gegeben ist
if( nAbsWidth==USHRT_MAX )
commit c578cff319674bed6099b95a06305e0ee4c4d90d
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Thu Feb 17 23:08:54 2011 +0100
Fixed RTF import/export of new border lines
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index c1e0aed..c486ef8 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -154,72 +154,75 @@ using namespace ::com::sun::star;
static OString OutTBLBorderLine(RtfExport &rExport, const SvxBorderLine* pLine, const sal_Char* pStr)
{
OStringBuffer aRet;
- aRet.append(pStr);
- // single line
- switch ( pLine->GetStyle( ) )
+ if ( !pLine->isEmpty() )
{
- case SOLID:
- {
- if( DEF_LINE_WIDTH_0 == pLine->GetWidth() )
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRHAIR);
- else
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRS);
- }
- break;
- case DOTTED:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDOT);
- break;
- case DASHED:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDASH);
- break;
- case DOUBLE:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDB);
- break;
- case THINTHICK_SMALLGAP:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTNTHSG);
- break;
- case THINTHICK_MEDIUMGAP:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTNTHMG);
- break;
- case THINTHICK_LARGEGAP:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTNTHLG);
- break;
- case THICKTHIN_SMALLGAP:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTHTNSG);
- break;
- case THICKTHIN_MEDIUMGAP:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTHTNMG);
- break;
- case THICKTHIN_LARGEGAP:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTHTNLG);
- break;
- case EMBOSSED:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDREMBOSS);
- break;
- case ENGRAVED:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRENGRAVE);
- break;
- case OUTSET:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDROUTSET);
- break;
- case INSET:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRINSET);
- break;
- case NO_STYLE:
- default:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRNONE);
- break;
- }
+ aRet.append(pStr);
+ // single line
+ switch ( pLine->GetStyle( ) )
+ {
+ case SOLID:
+ {
+ if( DEF_LINE_WIDTH_0 == pLine->GetWidth() )
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRHAIR);
+ else
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRS);
+ }
+ break;
+ case DOTTED:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDOT);
+ break;
+ case DASHED:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDASH);
+ break;
+ case DOUBLE:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDB);
+ break;
+ case THINTHICK_SMALLGAP:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTNTHSG);
+ break;
+ case THINTHICK_MEDIUMGAP:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTNTHMG);
+ break;
+ case THINTHICK_LARGEGAP:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTNTHLG);
+ break;
+ case THICKTHIN_SMALLGAP:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTHTNSG);
+ break;
+ case THICKTHIN_MEDIUMGAP:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTHTNMG);
+ break;
+ case THICKTHIN_LARGEGAP:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTHTNLG);
+ break;
+ case EMBOSSED:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDREMBOSS);
+ break;
+ case ENGRAVED:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRENGRAVE);
+ break;
+ case OUTSET:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDROUTSET);
+ break;
+ case INSET:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRINSET);
+ break;
+ case NO_STYLE:
+ default:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRNONE);
+ break;
+ }
- if ( 255 >= pLine->GetWidth() ) // That value comes from RTF specs
- {
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW).append((sal_Int32)pLine->GetWidth());
- }
- else
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTH OOO_STRING_SVTOOLS_RTF_BRDRW).append((sal_Int32)pLine->GetWidth() / 2);
+ if ( 255 >= pLine->GetWidth() ) // That value comes from RTF specs
+ {
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW).append((sal_Int32)pLine->GetWidth());
+ }
+ else
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTH OOO_STRING_SVTOOLS_RTF_BRDRW).append((sal_Int32)pLine->GetWidth() / 2);
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRCF);
- aRet.append((sal_Int32)rExport.GetColor(pLine->GetColor()));
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRCF);
+ aRet.append((sal_Int32)rExport.GetColor(pLine->GetColor()));
+ }
return aRet.makeStringAndClear();
}
@@ -233,22 +236,6 @@ static OString OutBorderLine(RtfExport &rExport, const SvxBorderLine* pLine,
return aRet.makeStringAndClear();
}
-static OString OutBorderLine( RtfExport &rExport, const SvxBorderLine* pLine,
- const char* pStr )
-{
- OStringBuffer aRet;
- aRet.append(pStr);
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDLNCOL);
- aRet.append((sal_Int32)rExport.GetColor( pLine->GetColor() ) );
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDLNIN);
- aRet.append((sal_Int32)pLine->GetInWidth());
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDLNOUT);
- aRet.append((sal_Int32)pLine->GetOutWidth());
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDLNDIST);
- aRet.append((sal_Int32)pLine->GetDistance());
- return aRet.makeStringAndClear();
-}
-
void RtfAttributeOutput::RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript )
{
OSL_TRACE("%s", OSL_THIS_FUNC);
@@ -2892,20 +2879,6 @@ void RtfAttributeOutput::FormatBox( const SvxBoxItem& rBox )
}
}
- const sal_uInt16* pBrd = aBorders;
- const sal_Char** pBrdNms = (const sal_Char**)aBorderNames;
- for( int i = 0; i < 4; ++i, ++pBrd, ++pBrdNms )
- {
- const SvxBorderLine* pLn = rBox.GetLine( *pBrd );
- if( pLn )
- {
- m_aSectionBreaks.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE);
- m_aSectionBreaks.append(OutBorderLine( m_rExport, pLn, *pBrdNms ));
- m_aSectionBreaks.append("}" OOO_STRING_SVTOOLS_RTF_BRSP);
- m_aSectionBreaks.append((sal_Int32)rBox.GetDistance( *pBrd ));
- }
- }
-
if (!m_bBufferSectionBreaks)
m_aStyles.append(m_aSectionBreaks.makeStringAndClear());
}
commit e15ecacd646dc9a7645af9048304b44587f55df5
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Mon Jan 24 09:21:49 2011 +0100
Merged borders of paragraphs were having angles
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 9695c67..87426a8 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4156,6 +4156,7 @@ void lcl_PaintLeftRightLine( const sal_Bool _bLeft,
const SvxBorderLine* pLeftRightBorder = 0;
const SvxBorderLine* pTopBorder = rBox.GetTop();
const SvxBorderLine* pBottomBorder = rBox.GetBottom();
+
if ( _bLeft )
{
pLeftRightBorder = bR2L ? rBox.GetRight() : rBox.GetLeft();
@@ -4190,6 +4191,10 @@ void lcl_PaintLeftRightLine( const sal_Bool _bLeft,
if ( bCnt )
{
::lcl_ExtendLeftAndRight( aRect, _rFrm, _rAttrs, _rRectFn );
+
+ // No Top / bottom borders for joint borders
+ if ( _rAttrs.JoinedWithPrev( _rFrm ) ) pTopBorder = NULL;
+ if ( _rAttrs.JoinedWithNext( _rFrm ) ) pBottomBorder = NULL;
}
// OD 06.05.2003 #107169# - adjustments for printer output device
commit d2b8ddf30bc133caea6af8bbb9b91213f319c1f1
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Thu Jan 20 15:25:03 2011 +0100
Fixes for ODT filter related to new borders
diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx
index adaaba0..72f2e8d 100644
--- a/sw/source/filter/xml/xmlimpit.cxx
+++ b/sw/source/filter/xml/xmlimpit.cxx
@@ -505,25 +505,19 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
if( !aTokenEnum.getNextToken( aToken ) )
return sal_False;
- if( !rUnitConverter.convertMeasure( nInWidth, aToken,
- DEF_LINE_WIDTH_0,
- DEF_LINE_WIDTH_4 ) )
+ if( !rUnitConverter.convertMeasure( nInWidth, aToken ) )
return sal_False;
if( !aTokenEnum.getNextToken( aToken ) )
return sal_False;
- if( !rUnitConverter.convertMeasure( nDistance, aToken,
- DEF_LINE_WIDTH_0,
- DEF_LINE_WIDTH_4 ) )
+ if( !rUnitConverter.convertMeasure( nDistance, aToken ) )
return sal_False;
if( !aTokenEnum.getNextToken( aToken ) )
return sal_False;
- if( !rUnitConverter.convertMeasure( nOutWidth, aToken,
- DEF_LINE_WIDTH_0,
- DEF_LINE_WIDTH_4 ) )
+ if( !rUnitConverter.convertMeasure( nOutWidth, aToken ) )
return sal_False;
// #i61946: accept line style even it's not part of our "normal" set of line styles
diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx
index 2e10f85..6af9cfc 100644
--- a/sw/source/filter/xml/xmlithlp.cxx
+++ b/sw/source/filter/xml/xmlithlp.cxx
@@ -159,25 +159,6 @@ void lcl_frmitems_setXMLBorderStyle( SvxBorderLine& rLine, sal_uInt16 nStyle )
rLine.SetStyle( eStyle );
}
-void lcl_frmitems_setXMLBorderWidth( SvxBorderLine& rLine,
- sal_uInt16 nWidth, sal_Bool bDouble )
-{
- const sal_uInt16 *aWidths;
- sal_uInt16 nSize;
-
- sal_uInt16 i = (nSize / sizeof(sal_uInt16)) - 4;
- while( i>0 &&
- nWidth <= ((aWidths[i] + aWidths[i-4]) / 2) )
- {
- DBG_ASSERT( aWidths[i] >= aWidths[i-4], "line widths are unordered!" );
- i -= 4;
- }
-
- if ( bDouble )
- rLine.SetStyle( DOUBLE );
- rLine.SetWidth( aBorderWidths[i] );
-}
-
sal_Bool lcl_frmitems_setXMLBorder( SvxBorderLine*& rpLine,
sal_Bool bHasStyle, sal_uInt16 nStyle,
sal_Bool bHasWidth, sal_uInt16 nWidth,
@@ -208,12 +189,10 @@ sal_Bool lcl_frmitems_setXMLBorder( SvxBorderLine*& rpLine,
if( ( bHasWidth &&
- (USHRT_MAX != nNamedWidth || (nWidth != rpLine->GetOutWidth() +
- rpLine->GetInWidth() +
- rpLine->GetDistance()) ) ) ||
+ (USHRT_MAX != nNamedWidth || (nWidth != rpLine->GetWidth() ) ) ) ||
( bHasStyle &&
((SVX_XML_BORDER_STYLE_SOLID == nStyle && rpLine->GetDistance()) ||
- (SVX_XML_BORDER_STYLE_DOUBLE == nStyle && !rpLine->GetDistance())) ))
+ (SVX_XML_BORDER_STYLE_DOUBLE == nStyle && !rpLine->GetDistance())) ) )
{
sal_Bool bDouble = (bHasWidth && SVX_XML_BORDER_STYLE_DOUBLE == nStyle ) ||
rpLine->GetDistance();
@@ -231,7 +210,7 @@ sal_Bool lcl_frmitems_setXMLBorder( SvxBorderLine*& rpLine,
nWidth = rpLine->GetInWidth() + rpLine->GetDistance() +
rpLine->GetOutWidth();
- lcl_frmitems_setXMLBorderWidth( *rpLine, nWidth, bDouble );
+ rpLine->SetWidth( nWidth );
}
lcl_frmitems_setXMLBorderStyle( *rpLine, nStyle );
}
@@ -251,7 +230,7 @@ void lcl_frmitems_setXMLBorder( SvxBorderLine*& rpLine,
rpLine = new SvxBorderLine;
if( nWidth > 0 )
- lcl_frmitems_setXMLBorderWidth( *rpLine, nWidth, sal_True );
+ rpLine->SetWidth( nWidth );
else
rpLine->GuessLinesWidths( DOUBLE, nOutWidth, nInWidth, nDistance );
}
commit c43a3eb7d66cbeb23bd1a165fb99d72db5124101
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Thu Jan 20 15:24:31 2011 +0100
Fixes for WW8 filter related to new borders
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index bb853dc..0725543 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1657,11 +1657,10 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrmFmt& rFmt,
nLineColor ^ 0xffffff );
MSO_LineStyle eStyle;
- if( pLine->GetInWidth() )
+ if( pLine->isDouble() )
{
// double line
- nLineWidth = pLine->GetInWidth() + pLine->GetOutWidth()
- + pLine->GetDistance();
+ nLineWidth = pLine->GetWidth();
if( pLine->GetInWidth() == pLine->GetOutWidth() )
eStyle = mso_lineDouble;
else if( pLine->GetInWidth() < pLine->GetOutWidth() )
@@ -1673,7 +1672,7 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrmFmt& rFmt,
{
// simple line
eStyle = mso_lineSimple;
- nLineWidth = pLine->GetOutWidth();
+ nLineWidth = pLine->GetWidth();
}
rPropOpt.AddOpt( ESCHER_Prop_lineStyle, eStyle );
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 266104d..9690e38 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -4032,31 +4032,71 @@ WW8_BRC WW8Export::TranslateBorderLine(const SvxBorderLine& rLine,
// what SwRTFWriter::OutRTFBorder does in the RTF filter Eventually it
// would be nice if all this functionality was in the one place
WW8_BRC aBrc;
- sal_uInt16 nWidth = rLine.GetInWidth() + rLine.GetOutWidth();
+ sal_uInt16 nWidth = rLine.GetWidth();
sal_uInt8 brcType = 0, nColCode = 0;
if( nWidth ) // Linie ?
{
// BRC.brcType
- bool bDouble = 0 != rLine.GetInWidth() && 0 != rLine.GetOutWidth();
- bool bThick = !bDouble && !bWrtWW8 && nWidth > 75;
- if( bDouble )
- brcType = 3;
- else if( bThick )
+ bool bThick = !rLine.isDouble() && !bWrtWW8 && nWidth > 75;
+ if( bThick )
brcType = 2;
else
{
-
- brcType = 1;
+ brcType = 0;
if ( bWrtWW8 )
{
+ // All the border types values are available on
+ // http://msdn.microsoft.com/en-us/library/dd908142%28v=office.12%29.aspx
switch ( rLine.GetStyle( ) )
{
+ case SOLID:
+ {
+ if ( rLine.GetWidth( ) == DEF_LINE_WIDTH_0 )
+ brcType = 5;
+ else
+ brcType = 1;
+ }
+ break;
case DOTTED:
brcType = 6;
break;
case DASHED:
brcType = 7;
+ break;
+ case DOUBLE:
+ brcType = 3;
+ break;
+ case THINTHICK_SMALLGAP:
+ brcType = 11;
+ break;
+ case THINTHICK_MEDIUMGAP:
+ brcType = 14;
+ break;
+ case THINTHICK_LARGEGAP:
+ brcType = 17;
+ break;
+ case THICKTHIN_SMALLGAP:
+ brcType = 12;
+ break;
+ case THICKTHIN_MEDIUMGAP:
+ brcType = 15;
+ break;
+ case THICKTHIN_LARGEGAP:
+ brcType = 18;
+ break;
+ case EMBOSSED:
+ brcType = 24;
+ break;
+ case ENGRAVED:
+ brcType = 25;
+ break;
+ case OUTSET:
+ brcType = 26;
+ break;
+ case INSET:
+ brcType = 27;
+ break;
default:
break;
}
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index f364d42..c791f0a 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1627,26 +1627,22 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj,
const SvxBorderLine *pLine;
if (0 != (pLine = aBox.GetLine(BOX_LINE_LEFT)))
{
- rInnerDist.Left() -= (pLine->GetOutWidth() + pLine->GetInWidth() +
- pLine->GetDistance());
+ rInnerDist.Left() -= (pLine->GetScaledWidth());
}
if (0 != (pLine = aBox.GetLine(BOX_LINE_TOP)))
{
- rInnerDist.Top() -= (pLine->GetOutWidth() + pLine->GetInWidth() +
- pLine->GetDistance());
+ rInnerDist.Top() -= (pLine->GetScaledWidth());
}
if (0 != (pLine = aBox.GetLine(BOX_LINE_RIGHT)))
{
- rInnerDist.Right() -= (pLine->GetOutWidth() + pLine->GetInWidth() +
- pLine->GetDistance());
+ rInnerDist.Right() -= (pLine->GetScaledWidth());
}
if (0 != (pLine = aBox.GetLine(BOX_LINE_BOTTOM)))
{
- rInnerDist.Bottom() -= (pLine->GetOutWidth() + pLine->GetInWidth() +
- pLine->GetDistance());
+ rInnerDist.Bottom() -= (pLine->GetScaledWidth());
}
// set distances from box's border to text contained within the box
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index b499234..1b4f69e 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -3222,7 +3222,7 @@ void WW8TabDesc::AdjustNewBand()
const SvxBorderLine *pLeftLine = aCurrentBox.GetLine(BOX_LINE_LEFT);
int nCurrentRightLineWidth = 0;
if(pLeftLine)
- nCurrentRightLineWidth = pLeftLine->GetInWidth() + pLeftLine->GetOutWidth() + pLeftLine->GetDistance();
+ nCurrentRightLineWidth = pLeftLine->GetScaledWidth();
if (i != 0)
{
@@ -3231,7 +3231,7 @@ void WW8TabDesc::AdjustNewBand()
const SvxBorderLine *pRightLine = aOldBox.GetLine(BOX_LINE_RIGHT);
int nOldBoxRightLineWidth = 0;
if(pRightLine)
- nOldBoxRightLineWidth = pRightLine->GetInWidth() + pRightLine->GetOutWidth() + pRightLine->GetDistance();
+ nOldBoxRightLineWidth = pRightLine->GetScaledWidth();
if(nOldBoxRightLineWidth>nCurrentRightLineWidth)
aCurrentBox.SetLine(aOldBox.GetLine(BOX_LINE_RIGHT), BOX_LINE_LEFT);
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index de72c6a..4e1ab1f 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -1276,37 +1276,11 @@ sal_uInt8 lcl_ReadBorders(bool bVer67, WW8_BRC* brc, WW8PLCFx_Cp_FKP* pPap,
void GetLineIndex(SvxBoxItem &rBox, short nLineThickness, short nSpace, sal_uInt8 nCol, short nIdx,
sal_uInt16 nOOIndex, sal_uInt16 nWWIndex, short *pSize=0)
{
- //Word mirrors some indexes inside outside depending on its position, we
- //don't do that, so flip them here
- if (nWWIndex == WW8_TOP || nWWIndex == WW8_LEFT)
- {
- switch (nIdx)
- {
- case 11:
- case 12:
- nIdx = (nIdx == 11) ? 12 : 11;
- break;
- case 14:
- case 15:
- nIdx = (nIdx == 14) ? 15 : 14;
- break;
- case 17:
- case 18:
- nIdx = (nIdx == 17) ? 18 : 17;
- break;
- case 24:
- case 25:
- nIdx = (nIdx == 24) ? 25 : 24;
- break;
- }
- }
-
SvxBorderStyle eStyle = SOLID;
switch (nIdx)
{
// First the single lines
case 1:
- case 2:
case 5:
// and the unsupported special cases which we map to a single line
case 8:
@@ -1315,6 +1289,12 @@ void GetLineIndex(SvxBoxItem &rBox, short nLineThickness, short nSpace, sal_uInt
case 22:
eStyle = SOLID;
break;
+ case 2:
+ {
+ eStyle = SOLID;
+ nLineThickness *= 2;
+ }
+ break;
case 6:
eStyle = DOTTED;
break;
@@ -1358,6 +1338,12 @@ void GetLineIndex(SvxBoxItem &rBox, short nLineThickness, short nSpace, sal_uInt
case 25:
eStyle = ENGRAVED;
break;
+ case 26:
+ eStyle = OUTSET;
+ break;
+ case 27:
+ eStyle = INSET;
+ break;
default:
eStyle = SOLID;
break;
@@ -1365,7 +1351,7 @@ void GetLineIndex(SvxBoxItem &rBox, short nLineThickness, short nSpace, sal_uInt
SvxBorderLine aLine;
aLine.SetStyle( eStyle );
- aLine.SetWidth( long( nLineThickness * 2.5 ) ); // Convert 1/8th pt into twips
+ aLine.SetWidth( nLineThickness );
//No AUTO for borders as yet, so if AUTO, use BLACK
if (nCol == 0)
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 310098e..fc63edc 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -1307,29 +1307,14 @@ short WW8_BRC::DetermineBorderProperties(bool bVer67, short *pSpace,
{
//Note that codes over 25 are undocumented, and I can't create
//these 4 here in the wild.
- default:
case 2:
case 4:
case 5:
case 22:
DBG_WARNING("Can't create these from the menus, please report");
- case 1:
- case 6:
- case 7:
- case 8:
- case 9:
+ default:
case 23: //Only 3pt in the menus, but honours the size setting.
break;
- case 3:
- /*
- double line is three times the width of an ordinary line,
- except for the smallest 1/4 point size which appears to have
- exactly the same total border width as a 1/2 point size
- ordinary line, i.e. twice the nominal line width
- */
- nMSTotalWidth = (nMSTotalWidth == 5) ?
- nMSTotalWidth*2 : nMSTotalWidth*3;
- break;
case 10:
/*
triple line is five times the width of an ordinary line,
@@ -1346,97 +1331,6 @@ short WW8_BRC::DetermineBorderProperties(bool bVer67, short *pSpace,
else
nMSTotalWidth*=5;
break;
- case 11:
- case 12:
- /*
- small gap thin thick and thick thin appears to have a 3/4
- point line, a 3/4 point gap and a thick line of the specified
- width
- */
- nMSTotalWidth = nMSTotalWidth + 15*2;
- break;
- case 13:
- /*
- thin thick thin appears to have two outside 3/4 point lines,
- two 3/4 point gaps and a thick line of the specified width
- */
- nMSTotalWidth = nMSTotalWidth + 15*4;
- break;
- case 14:
- case 15:
- /*
- medium gap thin thick and thick thin appears to have a line
- 50% of the thick line, and an equal sized gap and then the
- thick line of the specified width. But it appears to only
- use one of the existing predefined widths for the thin line,
- so the closest smallest existing border to the halved thick
- line is used.
- */
- switch (nMSTotalWidth)
- {
- case 45: //2 1/4, closest to half is 1
- nMSTotalWidth += 20 + (nMSTotalWidth-1)/2;
- break;
- case 5:
- case 10:
- nMSTotalWidth += 5;
- break;
- case 15: //3/4, closest to half is 1/4
- nMSTotalWidth += 5 + (nMSTotalWidth-1)/2;
- break;
- default:
- nMSTotalWidth*=2;
- break;
- }
- break;
- case 16:
- /*
- medium gap thin thick thin appears to have a line
- 50% of the thick line, and an equal sized gap and then the
- thick line of the specified width. But it appears to only
- use one of the existing predefined widths for the thin
- line, so the closest smallest existing border to the halved
- thick line is used. Though some fudging at smaller sizes is
- still required.
- */
- switch (nMSTotalWidth)
- {
- case 45: //2 1/4, closest to half is 1
- nMSTotalWidth += nMSTotalWidth + 20 * 2;
- break;
- case 20:
- case 15:
- nMSTotalWidth += nMSTotalWidth + 7 * 2;
- break;
- case 10:
- case 5:
- nMSTotalWidth += 5 + 4;
- break;
- default:
- nMSTotalWidth*=3;
- break;
- }
- break;
- case 17:
- case 18:
- /*
- large gap thin thick and thick thin appears to have a thick
- line of 1 1/2 pt and a narrow of 3/4 point, with a distance
- between the two of the explicitly set line width
- */
- nMSTotalWidth+=15+30;
- break;
- case 19:
- /*
- large gap thin thick thin appears to have a thick line of 1
- 1/2 pt and two narrows of 3/4 point, with a distance between
- the two of the explicitly set line width, though the narrowest
- line appears to behave as if it was even smaller
- */
- if (nMSTotalWidth == 5)
- nMSTotalWidth = 3;
- nMSTotalWidth = nMSTotalWidth*2 + 15*2 + 30;
- break;
case 20:
/*
wave, the dimensions appear to be created by the drawing of
@@ -1455,19 +1349,6 @@ short WW8_BRC::DetermineBorderProperties(bool bVer67, short *pSpace,
*/
nMSTotalWidth += 45*2;
break;
- case 24:
- case 25:
- /*
- emboss and engrave consist of a three lines, the central is of
- the explicit point width, the other two (of equal size to each
- other are the shadows and are either 3/4 pt of 1 1/2 depending
- on if the central line is greater of less than 2 1/4 pt
- */
- if (nMSTotalWidth <= 45)
- nMSTotalWidth += 2*15;
- else
- nMSTotalWidth += 2*30;
- break;
}
}
commit 20afec8314846c940ed45e6fa7a7ede5b13392c4
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Thu Jan 20 15:23:21 2011 +0100
Docx export of the new borders
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 0a8fa0b..94bdd3a 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1352,10 +1352,6 @@ static void impl_borderLine( FSHelperPtr pSerializer, sal_Int32 elementToken, co
{
FastAttributeList* pAttr = pSerializer->createAttrList();
- sal_uInt16 inW = pBorderLine->GetInWidth();
- sal_uInt16 outW = pBorderLine->GetOutWidth();
- sal_uInt16 nWidth = inW + outW;
-
// Compute val attribute value
// Can be one of:
// single, double,
@@ -1363,33 +1359,53 @@ static void impl_borderLine( FSHelperPtr pSerializer, sal_Int32 elementToken, co
// OOXml also supports those types of borders, but we'll try to play with the first ones.
// thickThinMediumGap, thickThinLargeGap, thickThinSmallGap
// thinThickLargeGap, thinThickMediumGap, thinThickSmallGap
- const char* pVal = "single";
- if ( pBorderLine->isDouble() )
+ const char* pVal = "none";
+ switch ( pBorderLine->GetStyle( ) )
{
- if ( inW == outW )
+ case SOLID:
+ pVal = ( sal_Char* )"single";
+ case DOTTED:
+ pVal = ( sal_Char* )"dotted";
+ break;
+ case DASHED:
+ pVal = ( sal_Char* )"dashed";
+ break;
+ case DOUBLE:
pVal = ( sal_Char* )"double";
- else if ( inW > outW )
- {
+ break;
+ case THINTHICK_SMALLGAP:
+ pVal = ( sal_Char* )"thinThickSmallGap";
+ break;
+ case THINTHICK_MEDIUMGAP:
pVal = ( sal_Char* )"thinThickMediumGap";
- }
- else if ( inW < outW )
- {
+ break;
+ case THINTHICK_LARGEGAP:
+ pVal = ( sal_Char* )"thinThickLargeGap";
+ break;
+ case THICKTHIN_SMALLGAP:
+ pVal = ( sal_Char* )"thickThinSmallGap";
+ break;
+ case THICKTHIN_MEDIUMGAP:
pVal = ( sal_Char* )"thickThinMediumGap";
- }
- }
- else
- {
- switch ( pBorderLine->GetStyle( ) )
- {
- case DOTTED:
- pVal = ( sal_Char* )"dotted";
- break;
- case DASHED:
- pVal = ( sal_Char* )"dashed";
- break;
- default:
- break;
- }
+ break;
+ case THICKTHIN_LARGEGAP:
+ pVal = ( sal_Char* )"thickThinLargeGap";
+ break;
+ case EMBOSSED:
+ pVal = ( sal_Char* )"embossed";
+ break;
+ case ENGRAVED:
+ pVal = ( sal_Char* )"engraved";
+ break;
+ case OUTSET:
+ pVal = ( sal_Char* )"outset";
+ break;
+ case INSET:
+ pVal = ( sal_Char* )"inset";
+ break;
+ case NO_STYLE:
+ default:
+ break;
}
pAttr->add( FSNS( XML_w, XML_val ), OString( pVal ) );
@@ -1397,7 +1413,7 @@ static void impl_borderLine( FSHelperPtr pSerializer, sal_Int32 elementToken, co
// Compute the sz attribute
// The unit is the 8th of point
- nWidth = sal_Int32( nWidth / 2.5 );
+ sal_Int32 nWidth = sal_Int32( pBorderLine->GetWidth() / 2.5 );
sal_uInt16 nMinWidth = 2;
sal_uInt16 nMaxWidth = 96;
commit 0263c1dfbb4ab2f3cf4a951670f5d3a11c5c4336
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Thu Jan 20 15:20:12 2011 +0100
Few fixes for RTF export and import of borders
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index e95d24e..c1e0aed 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -155,49 +155,69 @@ static OString OutTBLBorderLine(RtfExport &rExport, const SvxBorderLine* pLine,
{
OStringBuffer aRet;
aRet.append(pStr);
- if( pLine->GetInWidth() )
+ // single line
+ switch ( pLine->GetStyle( ) )
{
- // double line
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDB);
- switch( pLine->GetInWidth() )
- {
- case DEF_LINE_WIDTH_0:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW "15");
- break;
- case DEF_LINE_WIDTH_1:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW "30");
- break;
- case DEF_LINE_WIDTH_2:
- case DEF_LINE_WIDTH_3:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW "45");
- break;
- }
- }
- else
- {
- // single line
- if( DEF_LINE_WIDTH_0 == pLine->GetOutWidth() )
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRHAIR);
- else if ( 255 >= pLine->GetOutWidth() ) // That value comes from RTF specs
- {
- switch ( pLine->GetStyle( ) )
+ case SOLID:
{
- case DOTTED:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDOT);
- break;
- case DASHED:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDASH);
- break;
- case SOLID:
- default:
+ if( DEF_LINE_WIDTH_0 == pLine->GetWidth() )
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRHAIR);
+ else
aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRS);
}
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW).append((sal_Int32)pLine->GetOutWidth());
- }
- else
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTH OOO_STRING_SVTOOLS_RTF_BRDRW).append((sal_Int32)pLine->GetOutWidth() / 2);
+ break;
+ case DOTTED:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDOT);
+ break;
+ case DASHED:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDASH);
+ break;
+ case DOUBLE:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDB);
+ break;
+ case THINTHICK_SMALLGAP:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTNTHSG);
+ break;
+ case THINTHICK_MEDIUMGAP:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTNTHMG);
+ break;
+ case THINTHICK_LARGEGAP:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTNTHLG);
+ break;
+ case THICKTHIN_SMALLGAP:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTHTNSG);
+ break;
+ case THICKTHIN_MEDIUMGAP:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTHTNMG);
+ break;
+ case THICKTHIN_LARGEGAP:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTHTNLG);
+ break;
+ case EMBOSSED:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDREMBOSS);
+ break;
+ case ENGRAVED:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRENGRAVE);
+ break;
+ case OUTSET:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDROUTSET);
+ break;
+ case INSET:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRINSET);
+ break;
+ case NO_STYLE:
+ default:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRNONE);
+ break;
}
+ if ( 255 >= pLine->GetWidth() ) // That value comes from RTF specs
+ {
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW).append((sal_Int32)pLine->GetWidth());
+ }
+ else
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTH OOO_STRING_SVTOOLS_RTF_BRDRW).append((sal_Int32)pLine->GetWidth() / 2);
+
aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRCF);
aRet.append((sal_Int32)rExport.GetColor(pLine->GetColor()));
return aRet.makeStringAndClear();
commit 3a52869e8ced446bbffd72ea4174bcac7f3a2488
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Mon Jan 17 22:07:37 2011 +0100
Embossed and engraved to fit ODF specs
diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx
index 16936c7..d80e6d2 100644
--- a/sw/source/filter/xml/xmlexpit.cxx
+++ b/sw/source/filter/xml/xmlexpit.cxx
@@ -739,10 +739,10 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
eStyle = XML_DOUBLE;
break;
case EMBOSSED:
- eStyle = XML_EMBOSSED;
+ eStyle = XML_RIDGE;
break;
case ENGRAVED:
- eStyle = XML_ENGRAVED;
+ eStyle = XML_GROOVE;
break;
case INSET:
eStyle = XML_INSET;
commit 29285d471b6c3b1785ec3d508aa04633270964f0
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Wed Jan 12 23:30:45 2011 +0100
ODF export of new border types
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index c605c6f..0a68103 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -115,7 +115,7 @@ extern void lcl_GetTblBoxColStr( sal_uInt16 nCol, String& rNm );
table::BorderLine lcl_SvxLineToLine(const SvxBorderLine* pLine)
{
- table::BorderLine2 aLine;
+ table::BorderLine2 aLine;
if(pLine)
{
aLine.Color = pLine->GetColor().GetColor() ;
@@ -3312,7 +3312,7 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be
const SvxBoxInfoItem& rBoxInfoItem = (const SvxBoxInfoItem&)aSet.Get(SID_ATTR_BORDER_INNER);
const SvxBoxItem& rBox = (const SvxBoxItem&)aSet.Get(RES_BOX);
- table::TableBorder aTableBorder;
+ table::TableBorder aTableBorder;
aTableBorder.TopLine = lcl_SvxLineToLine(rBox.GetTop());
aTableBorder.IsTopLineValid = rBoxInfoItem.IsValid(VALID_TOP);
aTableBorder.BottomLine = lcl_SvxLineToLine(rBox.GetBottom());
diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx
index ca06612..16936c7 100644
--- a/sw/source/filter/xml/xmlexpit.cxx
+++ b/sw/source/filter/xml/xmlexpit.cxx
@@ -369,6 +369,25 @@ void SvXMLExportItemMapper::handleElementItem(
OSL_FAIL( "element item not handled in xml export" );
}
+bool lcl_isOdfDoubleLine( const SvxBorderLine* pLine )
+{
+ bool bIsOdfDouble = false;
+ switch ( pLine->GetStyle() )
+ {
+ case DOUBLE:
+ case THINTHICK_SMALLGAP:
+ case THINTHICK_MEDIUMGAP:
+ case THINTHICK_LARGEGAP:
+ case THICKTHIN_SMALLGAP:
+ case THICKTHIN_MEDIUMGAP:
+ case THICKTHIN_LARGEGAP:
+ bIsOdfDouble = true;
+ break;
+ default:
+ break;
+ }
+ return bIsOdfDouble;
+}
sal_Bool SvXMLExportItemMapper::QueryXMLValue(
const SfxPoolItem& rItem,
@@ -595,42 +614,51 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
const sal_uInt16 nDistance = pTop->GetDistance();
const sal_uInt16 nInWidth = pTop->GetInWidth();
const sal_uInt16 nOutWidth = pTop->GetOutWidth();
+ const sal_uInt16 nWidth = pTop->GetWidth();
bEqual = nDistance == pLeft->GetDistance() &&
nInWidth == pLeft->GetInWidth() &&
nOutWidth == pLeft->GetOutWidth() &&
+ nWidth == pLeft->GetWidth() &&
nDistance == pRight->GetDistance() &&
nInWidth == pRight->GetInWidth() &&
nOutWidth == pRight->GetOutWidth() &&
+ nWidth == pRight->GetWidth() &&
nDistance == pBottom->GetDistance() &&
nInWidth == pBottom->GetInWidth() &&
- nOutWidth == pBottom->GetOutWidth();
+ nOutWidth == pBottom->GetOutWidth() &&
+ nWidth == pBottom->GetWidth();
}
switch( nMemberId )
{
case ALL_BORDER_LINE_WIDTH:
- if( !bEqual || pTop->GetDistance() == 0 )
+ if( !bEqual || pTop->GetDistance() == 0 ||
+ !lcl_isOdfDoubleLine( pTop ) )
return sal_False;
break;
case LEFT_BORDER_LINE_WIDTH:
if( bEqual || NULL == pLeft ||
- 0 == pLeft->GetDistance() )
+ 0 == pLeft->GetDistance() ||
+ !lcl_isOdfDoubleLine( pLeft ) )
return sal_False;
break;
case RIGHT_BORDER_LINE_WIDTH:
if( bEqual || NULL == pRight ||
- 0 == pRight->GetDistance() )
+ 0 == pRight->GetDistance() ||
+ !lcl_isOdfDoubleLine( pRight ) )
return sal_False;
break;
case TOP_BORDER_LINE_WIDTH:
if( bEqual || NULL == pTop ||
- 0 == pTop->GetDistance() )
+ 0 == pTop->GetDistance() ||
+ !lcl_isOdfDoubleLine( pTop ) )
return sal_False;
break;
case BOTTOM_BORDER_LINE_WIDTH:
if( bEqual || NULL == pBottom ||
- 0 == pBottom->GetDistance() )
+ 0 == pBottom->GetDistance() ||
+ !lcl_isOdfDoubleLine( pBottom ) )
return sal_False;
break;
}
@@ -686,33 +714,55 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
if( NULL != pLine )
{
- sal_Int32 nWidth = pLine->GetOutWidth();
- const sal_uInt16 nDistance = pLine->GetDistance();
- if( 0 != nDistance )
- {
- nWidth += nDistance;
- nWidth += pLine->GetInWidth();
- }
+ sal_Int32 nWidth = pLine->GetWidth();
enum XMLTokenEnum eStyle = XML_SOLID;
+ bool bNoBorder = false;
switch ( pLine->GetStyle( ) )
{
+ case SOLID:
+ eStyle = XML_SOLID;
+ break;
case DOTTED:
- eStyle = XML_DOTTED;
- break;
+ eStyle = XML_DOTTED;
+ break;
case DASHED:
- eStyle = XML_DASHED;
- break;
+ eStyle = XML_DASHED;
+ break;
+ case DOUBLE:
+ case THINTHICK_SMALLGAP:
+ case THINTHICK_MEDIUMGAP:
+ case THINTHICK_LARGEGAP:
+ case THICKTHIN_SMALLGAP:
+ case THICKTHIN_MEDIUMGAP:
+ case THICKTHIN_LARGEGAP:
+ eStyle = XML_DOUBLE;
+ break;
+ case EMBOSSED:
+ eStyle = XML_EMBOSSED;
+ break;
+ case ENGRAVED:
+ eStyle = XML_ENGRAVED;
+ break;
+ case INSET:
+ eStyle = XML_INSET;
+ break;
+ case OUTSET:
+ eStyle = XML_OUTSET;
+ break;
default:
- eStyle = (0 == nDistance) ? XML_SOLID : XML_DOUBLE;
+ bNoBorder = true;
}
- rUnitConverter.convertMeasure( aOut, nWidth );
- aOut.append( sal_Unicode( ' ' ) );
- aOut.append( GetXMLToken( eStyle ) );
- aOut.append( sal_Unicode( ' ' ) );
- rUnitConverter.convertColor( aOut, pLine->GetColor() );
-
+ if ( !bNoBorder )
+ {
+ rUnitConverter.convertMeasure( aOut, nWidth,
+ MAP_TWIP, MAP_POINT );
+ aOut.append( sal_Unicode( ' ' ) );
+ aOut.append( GetXMLToken( eStyle ) );
+ aOut.append( sal_Unicode( ' ' ) );
+ rUnitConverter.convertColor( aOut, pLine->GetColor() );
+ }
}
else
{
diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx
index 2d5b8ee..2e10f85 100644
--- a/sw/source/filter/xml/xmlithlp.cxx
+++ b/sw/source/filter/xml/xmlithlp.cxx
@@ -51,11 +51,15 @@ using namespace ::xmloff::token;
using namespace ::com::sun::star;
-#define SVX_XML_BORDER_STYLE_NONE 0
-#define SVX_XML_BORDER_STYLE_SOLID 1
-#define SVX_XML_BORDER_STYLE_DOUBLE 2
-#define SVX_XML_BORDER_STYLE_DOTTED 3
-#define SVX_XML_BORDER_STYLE_DASHED 4
+#define API_LINE_NONE USHRT_MAX
+#define API_LINE_SOLID 0
+#define API_LINE_DOTTED 1
+#define API_LINE_DASHED 2
+#define API_LINE_DOUBLE 3
+#define API_LINE_EMBOSSED 10
+#define API_LINE_ENGRAVED 11
+#define API_LINE_OUTSET 12
+#define API_LINE_INSET 13
#define SVX_XML_BORDER_WIDTH_THIN 0
#define SVX_XML_BORDER_WIDTH_MIDDLE 1
@@ -64,16 +68,16 @@ using namespace ::com::sun::star;
const struct SvXMLEnumMapEntry psXML_BorderStyles[] =
{
- { XML_NONE, SVX_XML_BORDER_STYLE_NONE },
- { XML_HIDDEN, SVX_XML_BORDER_STYLE_NONE },
- { XML_SOLID, SVX_XML_BORDER_STYLE_SOLID },
- { XML_DOUBLE, SVX_XML_BORDER_STYLE_DOUBLE },
- { XML_DOTTED, SVX_XML_BORDER_STYLE_DOTTED },
- { XML_DASHED, SVX_XML_BORDER_STYLE_DASHED },
- { XML_GROOVE, SVX_XML_BORDER_STYLE_SOLID },
- { XML_RIDGE, SVX_XML_BORDER_STYLE_SOLID },
- { XML_INSET, SVX_XML_BORDER_STYLE_SOLID },
- { XML_OUTSET, SVX_XML_BORDER_STYLE_SOLID },
+ { XML_NONE, API_LINE_NONE },
+ { XML_HIDDEN, API_LINE_NONE },
+ { XML_SOLID, API_LINE_SOLID },
+ { XML_DOUBLE, API_LINE_DOUBLE },
+ { XML_DOTTED, API_LINE_DOTTED },
+ { XML_DASHED, API_LINE_DASHED },
+ { XML_GROOVE, API_LINE_ENGRAVED },
+ { XML_RIDGE, API_LINE_EMBOSSED },
+ { XML_INSET, API_LINE_INSET },
+ { XML_OUTSET, API_LINE_OUTSET },
{ XML_TOKEN_INVALID, 0 }
};
@@ -149,18 +153,9 @@ sal_Bool lcl_frmitems_parseXMLBorder( const OUString& rValue,
void lcl_frmitems_setXMLBorderStyle( SvxBorderLine& rLine, sal_uInt16 nStyle )
{
- SvxBorderStyle eStyle = SOLID;
- switch ( nStyle )
- {
- case SVX_XML_BORDER_STYLE_DOTTED:
- eStyle = DOTTED;
- break;
- case SVX_XML_BORDER_STYLE_DASHED:
- eStyle = DASHED;
- break;
- default:
- eStyle = SOLID;
- }
+ SvxBorderStyle eStyle = NO_STYLE;
+ if ( nStyle != API_LINE_NONE )
+ eStyle = SvxBorderStyle( nStyle );
rLine.SetStyle( eStyle );
}
commit 71b76ada48e7af2d5e2fb64af2dfc972135e1b82
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Mon Jan 10 21:15:51 2011 +0100
Getting total width directly using SvxBorderLine
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index bbb02a6..9695c67 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4124,7 +4124,7 @@ sal_uInt16 lcl_GetLineWidth( const SvxBorderLine* pLine )
sal_uInt16 result = 0;
if ( pLine != NULL )
- result = pLine->GetInWidth() + pLine->GetOutWidth() + pLine->GetDistance();
+ result = pLine->GetScaledWidth();
return result;
}
commit 2b629270f2ec6c084d5b0cad87945f8260fafd8b
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Fri Jan 7 13:40:46 2011 +0100
Switching the order of the SetLinesWidth arguments
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 69d35ed..c605c6f 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -142,9 +142,9 @@ sal_Bool lcl_LineToSvxLine(const table::BorderLine& rLine, SvxBorderLine& rSvxLi
rSvxLine.SetWidth( MM100_TO_TWIP_UNSIGNED( rLine2.LineWidth ) );
}
else
- rSvxLine.SetLinesWidths( SvxBorderStyle( rLine2.LineStyle ),
- MM100_TO_TWIP( rLine.InnerLineWidth ),
+ rSvxLine.GuessLinesWidths( SvxBorderStyle( rLine2.LineStyle ),
MM100_TO_TWIP( rLine.OuterLineWidth ),
+ MM100_TO_TWIP( rLine.InnerLineWidth ),
MM100_TO_TWIP( rLine.LineDistance ) );
sal_Bool bRet = rLine.InnerLineWidth > 0 || rLine.OuterLineWidth > 0 || rLine2.LineWidth > 0;
return bRet;
diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx
index 0879f8f..2d5b8ee 100644
--- a/sw/source/filter/xml/xmlithlp.cxx
+++ b/sw/source/filter/xml/xmlithlp.cxx
@@ -258,7 +258,7 @@ void lcl_frmitems_setXMLBorder( SvxBorderLine*& rpLine,
if( nWidth > 0 )
lcl_frmitems_setXMLBorderWidth( *rpLine, nWidth, sal_True );
else
- rpLine->SetLinesWidths( DOUBLE, nInWidth, nOutWidth, nDistance );
+ rpLine->GuessLinesWidths( DOUBLE, nOutWidth, nInWidth, nDistance );
}
const struct SvXMLEnumMapEntry psXML_BrushRepeat[] =
commit 3e3461dbf9a6231c922b7fc809226763c9a06e55
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Thu Jan 6 15:58:59 2011 +0100
One LineListBox to rule them all: started improving column sep line
diff --git a/sw/inc/fmtclds.hxx b/sw/inc/fmtclds.hxx
index e5dc2db..e54fcc3 100644
--- a/sw/inc/fmtclds.hxx
+++ b/sw/inc/fmtclds.hxx
@@ -28,6 +28,7 @@
#ifndef _FMTCLDS_HXX
#define _FMTCLDS_HXX
+#include <editeng/borderline.hxx>
#include <tools/color.hxx>
#include <svl/poolitem.hxx>
#include "swdllapi.h"
@@ -77,8 +78,9 @@ enum SwColLineAdj
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list