Commits

Anonymous committed be4c22f

[cbosdo04]Initial patch, but not complete yet

This patch brings the following features:
* Dashed and dotted borders (and loading/saving them in various formats)
* Separation of the border line types listbox and the width selection
* Support of more border types, but not persisted yet (needs ODF enhancements)
* Started to draw borders in sw using the drawinglayer

  • Participants
  • Parent commits 2e46017

Comments (0)

Files changed (91)

File cui/source/inc/border.hxx

     FixedLine           aFlSep1;
 	FixedLine			aFlLine;
     FixedText           aStyleFT;
-    LineListBox         aLbLineStyle;
+    LineStyleListBox    aLbLineStyle;
     FixedText           aColorFT;
 	ColorListBox		aLbLineColor;
+    FixedText           aWidthFT;
+    MetricField 		aLineWidthMF;
 
     FixedLine           aFlSep2;
 	FixedLine			aDistanceFL;
 	DECL_LINK( SelSdwHdl_Impl, void* );
 	DECL_LINK( LinesChanged_Impl, void* );
 	DECL_LINK( ModifyDistanceHdl_Impl, MetricField*);
+    DECL_LINK( ModifyWidthHdl_Impl, void*);
 	DECL_LINK( SyncHdl_Impl, CheckBox*);
 
     USHORT              GetPresetImageId( USHORT nValueSetIdx ) const;

File cui/source/tabpages/border.cxx

         aLbLineStyle    ( this, CUI_RES( LB_LINESTYLE ) ),
         aColorFT        ( this, CUI_RES( FT_COLOR ) ),
         aLbLineColor    ( this, CUI_RES( LB_LINECOLOR ) ),
+        aWidthFT        ( this, CUI_RES( FT_WIDTH ) ),
+        aLineWidthMF    ( this, CUI_RES( MF_LINEWIDTH ) ),
 
         aFlSep2         ( this, CUI_RES( FL_SEPARATOR2 ) ),
         aDistanceFL     ( this, CUI_RES( FL_DISTANCE ) ),
     aFrameSel.SetSelectHdl(LINK(this, SvxBorderTabPage, LinesChanged_Impl));
 	aLbLineStyle.SetSelectHdl( LINK( this, SvxBorderTabPage, SelStyleHdl_Impl ) );
 	aLbLineColor.SetSelectHdl( LINK( this, SvxBorderTabPage, SelColHdl_Impl ) );
+    aLineWidthMF.SetModifyHdl( LINK( this, SvxBorderTabPage, ModifyWidthHdl_Impl ) );
 	aLbShadowColor.SetSelectHdl( LINK( this, SvxBorderTabPage, SelColHdl_Impl ) );
 	aWndPresets.SetSelectHdl( LINK( this, SvxBorderTabPage, SelPreHdl_Impl ) );
 	aWndShadows.SetSelectHdl( LINK( this, SvxBorderTabPage, SelSdwHdl_Impl ) );
 	{
         // Do all visible lines show the same line widths?
         USHORT nPrim, nDist, nSecn;
-        bool bWidthEq = aFrameSel.GetVisibleWidth( nPrim, nDist, nSecn );
+        SvxBorderStyle nStyle;
+        bool bWidthEq = aFrameSel.GetVisibleWidth( nPrim, nDist, nSecn, nStyle );
         if( bWidthEq )
-            aLbLineStyle.SelectEntry( nPrim * 100, nSecn * 100, nDist * 100 );
+        {
+            // Determine the width first as some styles can be missing depending on it
+            long nWidth = aLbLineStyle.GetWidthFromStyle( nPrim * 5, nSecn * 5, nDist * 5, nStyle );
+            aLineWidthMF.SetValue( sal_Int64( nWidth ) );
+            aLbLineStyle.SetWidth( aLineWidthMF.GetValue( ) );
+
+            // then set the style
+            aLbLineStyle.SelectEntry( nPrim * 5, nSecn * 5, nDist * 5, nStyle );
+        }
         else
             aLbLineStyle.SelectEntryPos( 1 );
 
 	return 0;
 }
 
+IMPL_LINK( SvxBorderTabPage, ModifyWidthHdl_Impl, void *, EMPTYARG )
+{
+    sal_Int64 nVal = aLineWidthMF.GetValue( );
+    aLbLineStyle.SetWidth( nVal );
+    
+    aFrameSel.SetStyleToSelection(
+        static_cast< USHORT >( aLbLineStyle.GetSelectEntryLine1() / 5 ),
+        static_cast< USHORT >( aLbLineStyle.GetSelectEntryDistance() / 5 ),
+        static_cast< USHORT >( aLbLineStyle.GetSelectEntryLine2() / 5 ),
+        SvxBorderStyle( aLbLineStyle.GetSelectEntryStyle() ) );
+
+    return 0;
+}
+
 // -----------------------------------------------------------------------
 
 IMPL_LINK( SvxBorderTabPage, SelStyleHdl_Impl, ListBox *, pLb )
 {
 	if ( pLb == &aLbLineStyle )
-        aFrameSel.SetStyleToSelection(
-            static_cast< USHORT >( aLbLineStyle.GetSelectEntryLine1() / 100 ),
-            static_cast< USHORT >( aLbLineStyle.GetSelectEntryDistance() / 100 ),
-            static_cast< USHORT >( aLbLineStyle.GetSelectEntryLine2() / 100 ) );
+        aFrameSel.SetStyleToSelection (
+            static_cast< USHORT >( aLbLineStyle.GetSelectEntryLine1() / 5 ),
+            static_cast< USHORT >( aLbLineStyle.GetSelectEntryDistance() / 5 ),
+            static_cast< USHORT >( aLbLineStyle.GetSelectEntryLine2() / 5 ),
+            SvxBorderStyle( aLbLineStyle.GetSelectEntryStyle() ) );
 
 	return 0;
 }
 }
 
 // ============================================================================
+Color lcl_mediumColor( Color aMain, Color /*aDefault*/ )
+{
+    return SvxBorderLine::threeDMediumColor( aMain ); 
+}
 
 void SvxBorderTabPage::FillLineListBox_Impl()
 {
-	aLbLineStyle.SetUnit( FUNIT_POINT );
-	aLbLineStyle.SetSourceUnit( FUNIT_TWIP );
+    aLbLineStyle.SetNone( SVX_RESSTR( STR_NONE ) );
 
-	// Writer 2.0 Defaults:
-	aLbLineStyle.InsertEntry( SVX_RESSTR( RID_SVXSTR_NONE ) );
+    // Simple lines
+    aLbLineStyle.InsertEntry( 1.0, 0.0, 0.0, CHANGE_LINE1, SOLID );
+    aLbLineStyle.InsertEntry( 1.0, 0.0, 0.0, CHANGE_LINE1, DOTTED );
+    aLbLineStyle.InsertEntry( 1.0, 0.0, 0.0, CHANGE_LINE1, DASHED );
 
-	aLbLineStyle.InsertEntry( LINE_WIDTH0 );
-    aLbLineStyle.InsertEntry( LINE_WIDTH5 );
-    aLbLineStyle.InsertEntry( LINE_WIDTH1 );
-	aLbLineStyle.InsertEntry( LINE_WIDTH2 );
-	aLbLineStyle.InsertEntry( LINE_WIDTH3 );
-	aLbLineStyle.InsertEntry( LINE_WIDTH4 );
+    // Double lines
+    aLbLineStyle.InsertEntry( 1.0, 1.0, 1.0, CHANGE_LINE1 | CHANGE_LINE2 | CHANGE_DIST, DOUBLE );
+    aLbLineStyle.InsertEntry( 1.0, 75.0, 75.0, CHANGE_LINE1, THINTHICK_SMALLGAP, 100 );
+    aLbLineStyle.InsertEntry( 1.0, 0.5, 0.5, CHANGE_LINE1 | CHANGE_LINE2 | CHANGE_DIST, THINTHICK_MEDIUMGAP );
+    aLbLineStyle.InsertEntry( 75.0, 150.0, 1.0, CHANGE_DIST, THINTHICK_LARGEGAP );
+    aLbLineStyle.InsertEntry( 75.0, 1.0, 75.0, CHANGE_LINE2, THICKTHIN_SMALLGAP, 100 );
+    aLbLineStyle.InsertEntry( 0.5, 1.0, 0.5, CHANGE_LINE1 | CHANGE_LINE2 | CHANGE_DIST, THICKTHIN_MEDIUMGAP );
+    aLbLineStyle.InsertEntry( 150.0, 75.0, 1.0, CHANGE_DIST, THICKTHIN_LARGEGAP );
 
-	// OS: wenn hier neue Linienstaerken zugfuegt werden, dann
-	// LINESTYLE_HTML_MAX anpassen
+    // Engraved / Embossed
+    /*
+     *  Word compat: the lines widths are exactly following this rule, shouldbe:
+     *      0.75pt up to 3pt and then 3pt
+     */
+    aLbLineStyle.InsertEntry( 0.5, 0.5, 1, CHANGE_LINE1 | CHANGE_LINE2 | CHANGE_DIST, EMBOSSED, 75, 
+            &SvxBorderLine::threeDLightColor, &SvxBorderLine::threeDDarkColor,
+            &lcl_mediumColor );
+    aLbLineStyle.InsertEntry( 0.5, 0.5, 1, CHANGE_LINE1 | CHANGE_LINE2 | CHANGE_DIST, ENGRAVED, 75,
+            &SvxBorderLine::threeDDarkColor, &SvxBorderLine::threeDLightColor,
+            &lcl_mediumColor );
 
-	aLbLineStyle.InsertEntry( DLINE0_OUT, DLINE0_IN, DLINE0_DIST );
-	aLbLineStyle.InsertEntry( DLINE7_OUT, DLINE7_IN, DLINE7_DIST );
-	aLbLineStyle.InsertEntry( DLINE1_OUT, DLINE1_IN, DLINE1_DIST );
-	aLbLineStyle.InsertEntry( DLINE2_OUT, DLINE2_IN, DLINE2_DIST );
-	aLbLineStyle.InsertEntry( DLINE8_OUT, DLINE8_IN, DLINE8_DIST );
-	aLbLineStyle.InsertEntry( DLINE9_OUT, DLINE9_IN, DLINE9_DIST );
-	aLbLineStyle.InsertEntry( DLINE10_OUT,DLINE10_IN,DLINE10_DIST);
-	aLbLineStyle.InsertEntry( DLINE3_OUT, DLINE3_IN, DLINE3_DIST );
-	aLbLineStyle.InsertEntry( DLINE4_OUT, DLINE4_IN, DLINE4_DIST );
-	aLbLineStyle.InsertEntry( DLINE5_OUT, DLINE5_IN, DLINE5_DIST );
-	aLbLineStyle.InsertEntry( DLINE6_OUT, DLINE6_IN, DLINE6_DIST );
+    // Inset / Outset
+    /*
+     * Word compat: the gap width should be measured relatively to the biggest width for the
+     *      row or column.
+     */
+    aLbLineStyle.InsertEntry( 75.0, 1.0, 1.0, CHANGE_LINE2 | CHANGE_DIST, OUTSET, 0.5, 
+           &SvxBorderLine::lightColor, &SvxBorderLine::darkColor );
+    aLbLineStyle.InsertEntry( 1.0, 75.0, 1.0, CHANGE_LINE1 | CHANGE_DIST, INSET, 0.5, 
+           &SvxBorderLine::darkColor, &SvxBorderLine::lightColor );
+
+    aLbLineStyle.SetWidth( aLineWidthMF.GetValue( ) );
 }
 
 // -----------------------------------------------------------------------

File cui/source/tabpages/border.hrc

 #define FL_LINE                 20
 #define LB_LINESTYLE            21
 #define LB_LINECOLOR            22
+#define MF_LINEWIDTH            23
 
 #define FL_SEPARATOR2           29
 #define FL_SHADOW               30
 #define FL_PROPERTIES           64
 #define CB_MERGEWITHNEXT        65
 #define CB_MERGEADJACENTBORDERS 66
+#define FT_WIDTH                67
 
 // ImageListe fuer ValueSets:
 #define IL_PRE_BITMAPS			1400

File cui/source/tabpages/border.src

 		Border = TRUE ;
         Pos = MAP_APPFONT ( 88 , 25 ) ;
         Size = MAP_APPFONT ( 74 , 66 ) ;
+        DropDown = TRUE ;
+    };
+    FixedText FT_WIDTH
+    {
+        Pos = MAP_APPFONT ( 88, 39 ) ;
+        Size = MAP_APPFONT ( 77, 8 ) ;
+        Text [ en-US ] = "~Width";
+    };
+    MetricField MF_LINEWIDTH
+    {
+        Border = TRUE ;
+        Pos = MAP_APPFONT ( 88 , 50 ) ;
+        Size = MAP_APPFONT ( 74 , 12 ) ;
+        Spin = TRUE ;
+        Repeat = TRUE ;
+        SpinSize = 25 ;
+        First = 25 ;
+        Last = 900 ;
+        Maximum = 900 ;
+        Minimum = 25 ;
+        DecimalDigits = 2 ;
+        Unit = FUNIT_POINT ;
 	};
     FixedText FT_COLOR
     {
-        Pos = MAP_APPFONT ( 88, 95 ) ;
+        Pos = MAP_APPFONT ( 88, 64 ) ;
         Size = MAP_APPFONT ( 77, 8 ) ;
         Text [ en-US ] = "~Color";
 	};
     ListBox LB_LINECOLOR
 	{
 		Border = TRUE ;
-        Pos = MAP_APPFONT ( 88 , 106 ) ;
+        Pos = MAP_APPFONT ( 88 , 75 ) ;
         Size = MAP_APPFONT ( 74 , 68 ) ;
 		DropDown = TRUE ;
 		DDExtraWidth = TRUE ;

File drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx

 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
 #include <basegfx/color/bcolor.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
 
 //////////////////////////////////////////////////////////////////////////////
 
 			double											mfRightWidth;
 
             /// edge overlap sizes
-			double											mfExtendInnerStart;
-			double											mfExtendInnerEnd;
-			double											mfExtendOuterStart;
-			double											mfExtendOuterEnd;
+			double											mfExtendLeftStart;
+			double											mfExtendLeftEnd;
+			double											mfExtendRightStart;
+			double											mfExtendRightEnd;
 
-            /// the line color
-			basegfx::BColor									maRGBColor;
+            /// the line colors
+            basegfx::BColor									maRGBColorRight;
+            basegfx::BColor									maRGBColorLeft;
+            basegfx::BColor									maRGBColorGap;
+            bool                                            mbHasGapColor;
+
+            short                                           mnStyle;
 
 			/// bitfield
             /// flags to influence inside/outside creation
 				return !basegfx::fTools::equalZero(mfRightWidth);
 			}
 
+            basegfx::B2DPolyPolygon getClipPolygon( ) const;
+
 		protected:
 			/// create local decomposition
 			virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
 				double fLeftWidth,
 				double fDistance,
 				double fRightWidth,
-				double fExtendInnerStart,
-				double fExtendInnerEnd,
-				double fExtendOuterStart,
-				double fExtendOuterEnd,
-				bool bCreateInside,
-				bool bCreateOutside,
-				const basegfx::BColor& rRGBColor);
+                double fExtendLeftStart,
+                double fExtendLeftEnd,
+                double fExtendRightStart,
+                double fExtendRightEnd,
+                const basegfx::BColor& rRGBColorRight,
+                const basegfx::BColor& rRGBColorLeft,
+                const basegfx::BColor& rRGBColorGap,
+                bool bHasGapColor,
+                const short nStyle );
 
 			/// data read access
 			const basegfx::B2DPoint& getStart() const { return maStart; }
 			double getLeftWidth() const { return mfLeftWidth; }
 			double getDistance() const { return mfDistance; }
 			double getRightWidth() const { return mfRightWidth; }
-			double getExtendInnerStart() const { return mfExtendInnerStart; }
-			double getExtendInnerEnd() const { return mfExtendInnerEnd; }
-			double getExtendOuterStart() const { return mfExtendOuterStart; }
-			double getExtendOuterEnd() const { return mfExtendOuterEnd; }
-			bool getCreateInside() const { return mbCreateInside; }
-			bool getCreateOutside() const { return mbCreateOutside; }
-			const basegfx::BColor& getRGBColor() const { return maRGBColor; }
+            double getExtendLeftStart() const { return mfExtendLeftStart; }
+            double getExtendLeftEnd() const { return mfExtendLeftEnd; }
+            double getExtendRightStart() const { return mfExtendRightStart; }
+            double getExtendRightEnd() const { return mfExtendRightEnd; }
+            const basegfx::BColor& getRGBColorRight () const { return maRGBColorRight; }
+            const basegfx::BColor& getRGBColorLeft () const { return maRGBColorLeft; }
+            const basegfx::BColor& getRGBColorGap () const { return maRGBColorGap; }
+            bool hasGapColor( ) const { return mbHasGapColor; }
+            short getStyle () const { return mnStyle; }
 
 			/// compare operator
 			virtual bool operator==(const BasePrimitive2D& rPrimitive) const;

File drawinglayer/source/primitive2d/borderlineprimitive2d.cxx

 #include <drawinglayer/primitive2d/borderlineprimitive2d.hxx>
 #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolygonclipper.hxx>
 #include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
 #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#include <svtools/borderhelper.hxx>
 #include <numeric>
+#include <algorithm>
 
 //////////////////////////////////////////////////////////////////////////////
 
 {
 	namespace primitive2d
 	{
+        basegfx::B2DPolyPolygon BorderLinePrimitive2D::getClipPolygon( ) const
+        {
+            basegfx::B2DPolygon clipPolygon;
+            
+            // Get the vectors
+            basegfx::B2DVector aVector( getEnd() - getStart() );
+            aVector.normalize();
+            const basegfx::B2DVector aPerpendicular(basegfx::getPerpendicular(aVector));
+
+            // Get the points
+            const basegfx::B2DVector aLeftOff(aPerpendicular * (-0.5 * (getWidth())));
+            const basegfx::B2DVector aRightOff(aPerpendicular * (0.5 * (getWidth())));
+            clipPolygon.append( basegfx::B2DPoint(getStart() + aLeftOff - (getExtendLeftStart() * aVector)) );
+            clipPolygon.append( getStart( ) );
+            clipPolygon.append( basegfx::B2DPoint(getStart() + aRightOff - (getExtendRightStart() * aVector)) );
+            clipPolygon.append( basegfx::B2DPoint(getEnd() + aRightOff + (getExtendRightEnd() * aVector)) );
+            clipPolygon.append( getEnd( ) );
+            clipPolygon.append( basegfx::B2DPoint(getEnd() + aLeftOff + (getExtendLeftEnd() * aVector)) );
+
+            clipPolygon.setClosed( true );
+
+            return basegfx::B2DPolyPolygon( clipPolygon );
+        }
+
 		Primitive2DSequence BorderLinePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
 		{
 			Primitive2DSequence xRetval;
 
-			if(!getStart().equal(getEnd()) && (getCreateInside() || getCreateOutside()))
+			if(!getStart().equal(getEnd()) && getWidth() > 0)
 			{
-				if(isInsideUsed())
+                // get data and vectors
+                const double fWidth(getWidth());
+                basegfx::B2DVector aVector(getEnd() - getStart());
+                aVector.normalize();
+                const basegfx::B2DVector aPerpendicular(basegfx::getPerpendicular(aVector));
+
+                const basegfx::B2DPolyPolygon& aClipRegion = getClipPolygon( );
+
+				if(isOutsideUsed() && isInsideUsed())
 				{
-					// get data and vectors
-					const double fWidth(getWidth());
-					basegfx::B2DVector aVector(getEnd() - getStart());
-					aVector.normalize();
-					const basegfx::B2DVector aPerpendicular(basegfx::getPerpendicular(aVector));
+                    double startMax = std::max( getExtendLeftStart(), std::max( getExtendRightStart(), 0.0 ) );
+                    double endMax = std::max( getExtendLeftEnd(), std::max( getExtendRightEnd(), 0.0 ) );
 
-					if(isOutsideUsed())
+                    // both used, double line definition. Create left and right offset
+                    xRetval.realloc(2);
+                    sal_uInt32 nInsert(0);
+
+                    basegfx::B2DPolygon aGap;
+
 					{
-						// both used, double line definition. Create left and right offset
-						xRetval.realloc(getCreateInside() && getCreateOutside() ? 2 : 1);
-						sal_uInt32 nInsert(0);
-
-						if(getCreateInside())
-						{
-							// create geometry for left
-							const basegfx::B2DVector aLeftOff(aPerpendicular * (0.5 * (getCorrectedLeftWidth() - fWidth)));
-							const basegfx::B2DPoint aTmpStart(getStart() + aLeftOff - (getExtendInnerStart() * aVector));
-							const basegfx::B2DPoint aTmpEnd(getEnd() + aLeftOff + (getExtendInnerEnd() * aVector));
-							basegfx::B2DPolygon aLeft;
-
-							if(leftIsHairline())
-							{
-								// create hairline primitive
-								aLeft.append(aTmpStart);
-								aLeft.append(aTmpEnd);
-
-								xRetval[nInsert++] = Primitive2DReference(new PolygonHairlinePrimitive2D(
-									aLeft, 
-									getRGBColor()));
-							}
-							else
-							{
-								// create filled polygon primitive. Already tried to create thick lines
-								// with the correct LineWidth, but this leads to problems when no AA
-								// is available and fat line special case reductions between 0.5 < x < 2.5 line widths
-								// are executed due to the FilledPolygon-do-not-paint-their-bottom-and-right-lines.
-								const basegfx::B2DVector aLineWidthOffset((getCorrectedLeftWidth() * 0.5) * aPerpendicular);
-								
-								aLeft.append(aTmpStart + aLineWidthOffset);
-								aLeft.append(aTmpEnd + aLineWidthOffset);
-								aLeft.append(aTmpEnd - aLineWidthOffset);
-								aLeft.append(aTmpStart - aLineWidthOffset);
-								aLeft.setClosed(true);
-
-								xRetval[nInsert++] = Primitive2DReference(new PolyPolygonColorPrimitive2D(
-									basegfx::B2DPolyPolygon(aLeft), getRGBColor()));
-							}
-						}
-
-						if(getCreateOutside())
-						{
-							// create geometry for right
-							const basegfx::B2DVector aRightOff(aPerpendicular * (0.5 * (fWidth - getCorrectedRightWidth())));
-							const basegfx::B2DPoint aTmpStart(getStart() + aRightOff - (getExtendOuterStart() * aVector));
-							const basegfx::B2DPoint aTmpEnd(getEnd() + aRightOff + (getExtendOuterEnd() * aVector));
-							basegfx::B2DPolygon aRight;
-
-							if(rightIsHairline())
-							{
-								// create hairline primitive
-								aRight.append(aTmpStart);
-								aRight.append(aTmpEnd);
-								
-								xRetval[nInsert++] = Primitive2DReference(new PolygonHairlinePrimitive2D(
-									aRight, 
-									getRGBColor()));
-							}
-							else
-							{
-								// create filled polygon primitive
-								const basegfx::B2DVector aLineWidthOffset((getCorrectedRightWidth() * 0.5) * aPerpendicular);
-
-								aRight.append(aTmpStart + aLineWidthOffset);
-								aRight.append(aTmpEnd + aLineWidthOffset);
-								aRight.append(aTmpEnd - aLineWidthOffset);
-								aRight.append(aTmpStart - aLineWidthOffset);
-								aRight.setClosed(true);
-
-								xRetval[nInsert++] = Primitive2DReference(new PolyPolygonColorPrimitive2D(
-									basegfx::B2DPolyPolygon(aRight), getRGBColor()));
-							}
-						}
-					}
-					else
-					{
-						// single line, create geometry
-						basegfx::B2DPolygon aPolygon;
-						const double fMaxExtStart(::std::max(getExtendInnerStart(), getExtendOuterStart()));
-						const double fMaxExtEnd(::std::max(getExtendInnerEnd(), getExtendOuterEnd()));
-						const basegfx::B2DPoint aTmpStart(getStart() - (fMaxExtStart * aVector));
-						const basegfx::B2DPoint aTmpEnd(getEnd() + (fMaxExtEnd * aVector));
-						xRetval.realloc(1);
+                        // create geometry for left
+                        const basegfx::B2DVector aLeftOff(aPerpendicular * (0.5 * (getCorrectedLeftWidth() - fWidth + 1)));
+                        const basegfx::B2DPoint aTmpStart(getStart() + aLeftOff - ( startMax * aVector));
+                        const basegfx::B2DPoint aTmpEnd(getEnd() + aLeftOff + ( endMax * aVector));
+                        basegfx::B2DPolygon aLeft;
 
 						if(leftIsHairline())
 						{
+                            // create hairline primitive
+                            aLeft.append(aTmpStart);
+                            aLeft.append(aTmpEnd);
+
+                            xRetval[nInsert++] = Primitive2DReference(new PolygonHairlinePrimitive2D(
+                                aLeft, 
+                                getRGBColorLeft()));
+
+                            aGap.append( aTmpStart );
+                            aGap.append( aTmpEnd );
+                        }
+                        else
+						{
+                            // create filled polygon primitive. Already tried to create thick lines
+                            // with the correct LineWidth, but this leads to problems when no AA
+                            // is available and fat line special case reductions between 0.5 < x < 2.5 line widths
+                            // are executed due to the FilledPolygon-do-not-paint-their-bottom-and-right-lines.
+                            const basegfx::B2DVector aLineWidthOffset((getCorrectedLeftWidth() * 0.5) * aPerpendicular);
+                            
+                            aLeft.append(aTmpStart + aLineWidthOffset);
+                            aLeft.append(aTmpEnd + aLineWidthOffset);
+                            aLeft.append(aTmpEnd - aLineWidthOffset);
+                            aLeft.append(aTmpStart - aLineWidthOffset);
+                            aLeft.setClosed(true);
+
+                            basegfx::B2DPolyPolygon aClipped = basegfx::tools::clipPolygonOnPolyPolygon( 
+                                    aLeft, aClipRegion, true, false );
+
+                            aGap.append( aTmpStart + aLineWidthOffset );
+                            aGap.append( aTmpEnd + aLineWidthOffset );
+
+                            xRetval[nInsert++] = Primitive2DReference(new PolyPolygonColorPrimitive2D(
+                                aClipped, getRGBColorLeft()));
+						}
+					}
+
+					{
+                        // create geometry for right
+                        const basegfx::B2DVector aRightOff(aPerpendicular * (0.5 * (fWidth - getCorrectedRightWidth() + 1)));
+                        const basegfx::B2DPoint aTmpStart(getStart() + aRightOff - ( startMax * aVector));
+                        const basegfx::B2DPoint aTmpEnd(getEnd() + aRightOff + ( endMax * aVector));
+                        basegfx::B2DPolygon aRight;
+
+						if(rightIsHairline())
+						{
 							// create hairline primitive
-							aPolygon.append(aTmpStart);
-							aPolygon.append(aTmpEnd);
+                            aRight.append(aTmpStart);
+                            aRight.append(aTmpEnd);
+                            
+                            xRetval[nInsert++] = Primitive2DReference(new PolygonHairlinePrimitive2D(
+                                aRight, 
+                                getRGBColorRight()));
 
-							xRetval[0] = Primitive2DReference(new PolygonHairlinePrimitive2D(
-								aPolygon, 
-								getRGBColor()));
+                            aGap.append( aTmpEnd );
+                            aGap.append( aTmpStart );
 						}
 						else
 						{
 							// create filled polygon primitive
-							const basegfx::B2DVector aLineWidthOffset((getCorrectedLeftWidth() * 0.5) * aPerpendicular);
+                            const basegfx::B2DVector aLineWidthOffset((getCorrectedRightWidth() * 0.5) * aPerpendicular);
+
+                            aRight.append(aTmpStart + aLineWidthOffset);
+                            aRight.append(aTmpEnd + aLineWidthOffset);
+                            aRight.append(aTmpEnd - aLineWidthOffset);
+                            aRight.append(aTmpStart - aLineWidthOffset);
+                            aRight.setClosed(true);
+
+                            basegfx::B2DPolyPolygon aClipped = basegfx::tools::clipPolygonOnPolyPolygon( 
+                                    aRight, aClipRegion, true, false );
+
+                            xRetval[nInsert++] = Primitive2DReference(new PolyPolygonColorPrimitive2D(
+                                aClipped, getRGBColorRight()));
+
+                            aGap.append( aTmpEnd - aLineWidthOffset );
+                            aGap.append( aTmpStart - aLineWidthOffset );
+                        }
+                    }
+                    
+                    if (hasGapColor() && aGap.count() == 4)
+                    {
+                        xRetval.realloc( xRetval.getLength() + 1 );
+                        // create geometry for filled gap
+                        aGap.setClosed( true );
+                        
+                        basegfx::B2DPolyPolygon aClipped = basegfx::tools::clipPolygonOnPolyPolygon( 
+                                aGap, aClipRegion, true, false );
+
+                        xRetval[nInsert++] = Primitive2DReference( new PolyPolygonColorPrimitive2D(
+                              aClipped, getRGBColorGap() ) );
+                    }
+                }
+                else
+                {
+                    // single line, create geometry
+                    basegfx::B2DPolygon aPolygon;
+                    const double fMaxExtStart = std::max( getExtendLeftStart(), 
+                            std::max( getExtendRightStart(), 0.0 ) );
+                    const double fMaxExtEnd = std::max( getExtendLeftEnd(), 
+                            std::max( getExtendRightEnd(), 0.0 ) );
+                    const basegfx::B2DPoint aTmpStart(getStart() - (fMaxExtStart * aVector));
+                    const basegfx::B2DPoint aTmpEnd(getEnd() + (fMaxExtEnd * aVector));
+                    xRetval.realloc(1);
+
+                    // Get which is the line to show
+                    bool bIsHairline = leftIsHairline();
+                    double nWidth = getCorrectedLeftWidth();
+                    basegfx::BColor aColor = getRGBColorLeft();
+                    if ( basegfx::fTools::equal( 0.0, mfLeftWidth ) )
+                    {
+                        bIsHairline = rightIsHairline();
+                        nWidth = getCorrectedRightWidth();
+                        aColor = getRGBColorRight();
+                    }
+
+                    if(bIsHairline)
+                    {
+                        // create hairline primitive
+                        aPolygon.append(aTmpStart);
+                        aPolygon.append(aTmpEnd);
+
+                        xRetval[0] = Primitive2DReference(new PolygonHairlinePrimitive2D(
+                            aPolygon, 
+                            aColor));
+                    }
+                    else
+                    {
+                        // create filled polygon primitive
+                        const basegfx::B2DVector aLineWidthOffset(((nWidth + 1) * 0.5) * aPerpendicular);
+                        
+                        aPolygon.append( aTmpStart );
+                        aPolygon.append( aTmpEnd );
+
+                        basegfx::B2DPolyPolygon aDashed = svtools::ApplyLineDashing( 
+                               aPolygon, getStyle(), MAP_100TH_MM );
+                        for (sal_uInt32 i = 0; i < aDashed.count(); i++ )
+                        {
+                            basegfx::B2DPolygon aDash = aDashed.getB2DPolygon( i );
+                            basegfx::B2DPoint aDashStart = aDash.getB2DPoint( 0 );
+                            basegfx::B2DPoint aDashEnd = aDash.getB2DPoint( aDash.count() - 1 );
+
+                            basegfx::B2DPolygon aDashPolygon;
+                            aDashPolygon.append( aDashStart + aLineWidthOffset );
+                            aDashPolygon.append( aDashEnd + aLineWidthOffset );
+                            aDashPolygon.append( aDashEnd - aLineWidthOffset );
+                            aDashPolygon.append( aDashStart - aLineWidthOffset );
+                            aDashPolygon.setClosed( true );
+                        
+                            basegfx::B2DPolyPolygon aClipped = basegfx::tools::clipPolygonOnPolyPolygon(
+                                aDashPolygon, aClipRegion, true, false );
 							
-							aPolygon.append(aTmpStart + aLineWidthOffset);
-							aPolygon.append(aTmpEnd + aLineWidthOffset);
-							aPolygon.append(aTmpEnd - aLineWidthOffset);
-							aPolygon.append(aTmpStart - aLineWidthOffset);
-							aPolygon.setClosed(true);
-
-							xRetval[0] = Primitive2DReference(new PolyPolygonColorPrimitive2D(
-								basegfx::B2DPolyPolygon(aPolygon), getRGBColor()));
+                            if ( aClipped.count() )
+                                aDashed.setB2DPolygon( i, aClipped.getB2DPolygon( 0 ) );
 						}
+                           
+                        xRetval[0] = Primitive2DReference(new PolyPolygonColorPrimitive2D(
+                                basegfx::B2DPolyPolygon( aDashed ), aColor));
 					}
 				}
 			}
 			double fLeftWidth,
 			double fDistance,
 			double fRightWidth,
-			double fExtendInnerStart,
-			double fExtendInnerEnd,
-			double fExtendOuterStart,
-			double fExtendOuterEnd,
-			bool bCreateInside,
-			bool bCreateOutside,
-			const basegfx::BColor& rRGBColor)
+            double fExtendLeftStart,
+            double fExtendLeftEnd,
+            double fExtendRightStart,
+            double fExtendRightEnd,
+            const basegfx::BColor& rRGBColorRight,
+            const basegfx::BColor& rRGBColorLeft,
+            const basegfx::BColor& rRGBColorGap,
+            bool bHasGapColor,
+            short nStyle)
 		:	BufferedDecompositionPrimitive2D(),
 			maStart(rStart),
 			maEnd(rEnd),
 			mfLeftWidth(fLeftWidth),
 			mfDistance(fDistance),
 			mfRightWidth(fRightWidth),
-			mfExtendInnerStart(fExtendInnerStart),
-			mfExtendInnerEnd(fExtendInnerEnd),
-			mfExtendOuterStart(fExtendOuterStart),
-			mfExtendOuterEnd(fExtendOuterEnd),
-			maRGBColor(rRGBColor),
-			mbCreateInside(bCreateInside),
-			mbCreateOutside(bCreateOutside)
+            mfExtendLeftStart(fExtendLeftStart),
+            mfExtendLeftEnd(fExtendLeftEnd),
+            mfExtendRightStart(fExtendRightStart),
+            mfExtendRightEnd(fExtendRightEnd),
+            maRGBColorRight(rRGBColorRight),
+            maRGBColorLeft(rRGBColorLeft),
+            maRGBColorGap(rRGBColorGap),
+            mbHasGapColor(bHasGapColor),
+            mnStyle(nStyle)
 		{
 		}
 
 					&& getLeftWidth() == rCompare.getLeftWidth()
 					&& getDistance() == rCompare.getDistance()
 					&& getRightWidth() == rCompare.getRightWidth()
-					&& getExtendInnerStart() == rCompare.getExtendInnerStart()
-					&& getExtendInnerEnd() == rCompare.getExtendInnerEnd()
-					&& getExtendOuterStart() == rCompare.getExtendOuterStart()
-					&& getExtendOuterEnd() == rCompare.getExtendOuterEnd()
-					&& getCreateInside() == rCompare.getCreateInside()
-					&& getCreateOutside() == rCompare.getCreateOutside()
-					&& getRGBColor() == rCompare.getRGBColor());
+                    && getExtendLeftStart() == rCompare.getExtendLeftStart()
+                    && getExtendLeftEnd() == rCompare.getExtendLeftEnd()
+                    && getExtendRightStart() == rCompare.getExtendRightStart()
+                    && getExtendRightEnd() == rCompare.getExtendRightEnd()
+                    && getRGBColorRight() == rCompare.getRGBColorRight()
+                    && getRGBColorLeft() == rCompare.getRGBColorLeft()
+                    && getRGBColorGap() == rCompare.getRGBColorGap()
+                    && hasGapColor() == rCompare.hasGapColor()
+                    && getStyle() == rCompare.getStyle());
 			}
 
 			return false;

File editeng/inc/editeng/borderline.hxx

 
 // ============================================================================
 
+enum SvxBorderStyle
+{
+    SOLID,
+    DOTTED,
+    DASHED,
+    DOUBLE,
+    THINTHICK_SMALLGAP,
+    THINTHICK_MEDIUMGAP,
+    THINTHICK_LARGEGAP,
+    THICKTHIN_SMALLGAP,
+    THICKTHIN_MEDIUMGAP,
+    THICKTHIN_LARGEGAP,
+    EMBOSSED,
+    ENGRAVED,
+    OUTSET,
+    INSET
+};
+
 class EDITENG_DLLPUBLIC SvxBorderLine
 {
 protected:
 	USHORT nOutWidth;
 	USHORT nInWidth;
 	USHORT nDistance;
+    SvxBorderStyle   m_nStyle;
+
+    bool             m_bUseLeftTop;
+    Color            (*m_pColorOutFn)( Color );
+    Color            (*m_pColorInFn)( Color );
+    Color            (*m_pColorGapFn)( Color );
 
 public:
-	SvxBorderLine( const Color *pCol = 0, USHORT nOut = 0, USHORT nIn = 0, USHORT nDist = 0 );
+    SvxBorderLine( const Color *pCol = 0, USHORT nOut = 0, USHORT nIn = 0, USHORT nDist = 0, 
+            SvxBorderStyle nStyle = SOLID, bool bUseLeftTop = false,
+            Color (*pColorOutFn)( Color ) = &darkColor, Color (*pColorInFn)( Color ) = &darkColor,
+            Color (*pColorGapFn)( Color ) = NULL );
 	SvxBorderLine( const SvxBorderLine& r );
 
 	SvxBorderLine& operator=( const SvxBorderLine& r );
 
 	const Color&	GetColor() const { return aColor; }
+    Color           GetColorOut( bool bLeftOrTop = true ) const;
+    Color           GetColorIn( bool bLeftOrTop = true ) const;
+    BOOL            HasGapColor() const { return m_pColorGapFn != NULL; }
+    Color           GetColorGap() const;
 	USHORT 			GetOutWidth() const { return nOutWidth; }
 	USHORT 			GetInWidth() const { return nInWidth; }
 	USHORT 			GetDistance() const { return nDistance; }
 
+    SvxBorderStyle  GetStyle() const { return m_nStyle; }
+
 	void 			SetColor( const Color &rColor ) { aColor = rColor; }
+    void            SetColorOutFn( Color (*pColorOutFn)( Color ) ) { m_pColorOutFn = pColorOutFn; }
+    void            SetColorInFn( Color (*pColorInFn)( Color ) ) { m_pColorInFn = pColorInFn; }
+    void            SetColorGapFn( Color (*pColorGapFn)( Color ) ) { m_pColorGapFn = pColorGapFn; }
+    void            SetUseLeftTop( bool bUseLeftTop ) { m_bUseLeftTop = bUseLeftTop; }
 	void			SetOutWidth( USHORT nNew ) { nOutWidth = nNew; }
 	void			SetInWidth( USHORT nNew ) { nInWidth = nNew;  }
 	void			SetDistance( USHORT nNew ) { nDistance = nNew; }
+    void            SetStyle( SvxBorderStyle nNew );
 	void			ScaleMetrics( long nMult, long nDiv );
 
 	BOOL			operator==( const SvxBorderLine &rCmp ) const;
 	bool isEmpty() const { return (0 == nOutWidth && 0 == nInWidth && 0 == nDistance); }
 	bool isDouble() const { return (0 != nOutWidth && 0 != nInWidth); }
 	sal_uInt16 getWidth() const { return nOutWidth + nInWidth + nDistance; }
+
+    static Color darkColor( Color aMain );
+    static Color lightColor( Color aMain );
+
+    static Color threeDLightColor( Color aMain );
+    static Color threeDMediumColor( Color aMain );
+    static Color threeDDarkColor( Color aMain );
+
 };
 
 // ============================================================================

File editeng/inc/editeng/boxitem.hxx

 #include <svl/poolitem.hxx>
 #include <editeng/borderline.hxx>
 #include <editeng/editengdllapi.h>
-#include <com/sun/star/table/BorderLine.hpp>
+#include <com/sun/star/table/BorderLine2.hpp>
 
 namespace rtl { class OUString; }
 
 		//JP 09.06.99: bIgnoreLine = TRUE -> Distance auch returnen, wenn
 		//							keine Line gesetzt ist
 	USHORT 	CalcLineSpace( USHORT nLine, BOOL bIgnoreLine = FALSE ) const;
-    static com::sun::star::table::BorderLine SvxLineToLine( const SvxBorderLine* pLine, sal_Bool bConvert );
+    static com::sun::star::table::BorderLine2 SvxLineToLine( const SvxBorderLine* pLine, sal_Bool bConvert );
     static sal_Bool LineToSvxLine(const ::com::sun::star::table::BorderLine& rLine, SvxBorderLine& rSvxLine, sal_Bool bConvert);
 };
 

File editeng/inc/editeng/memberids.hrc

 #define MID_OUTER_WIDTH         0x41
 #define MID_INNER_WIDTH         0x35
 #define MID_LINESPACE           0x3b
+#define MID_LINE_STYLE          0x36
 
 //NameOrIndex
 #define MID_NAME				16

File editeng/source/items/frmitems.cxx

 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/script/XTypeConverter.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/table/BorderLine2.hpp>
 #include <com/sun/star/table/CellVertJustify.hpp>
 #include <com/sun/star/table/ShadowLocation.hpp>
 #include <com/sun/star/table/TableBorder.hpp>
 #include <svl/memberid.hrc>
 #include <svtools/wallitem.hxx>
 #include <svl/cntwall.hxx>
+#include <svtools/borderhelper.hxx>
 #include <rtl/ustring.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <svtools/filter.hxx>
 #include <editeng/memberids.hrc>
 #include <editeng/editerr.hxx>
 
+#include <basegfx/color/bcolor.hxx>
+#include <basegfx/color/bcolortools.hxx>
+
 using namespace ::rtl;
 using namespace ::com::sun::star;
 
 
 // class SvxBorderLine  --------------------------------------------------
 
-SvxBorderLine::SvxBorderLine( const Color *pCol, sal_uInt16 nOut, sal_uInt16 nIn, sal_uInt16 nDist )
+Color SvxBorderLine::darkColor( Color aMain )
+{
+    return aMain;
+}
+
+Color SvxBorderLine::lightColor( Color aMain )
+{
+    
+    // Divide Luminance by 2
+    basegfx::BColor color = aMain.getBColor( );
+    basegfx::BColor hsl = basegfx::tools::rgb2hsl( color ); 
+    hsl.setZ( hsl.getZ() * 0.5 );
+    color = basegfx::tools::hsl2rgb( hsl );
+
+    return Color( color );
+}
+
+Color lcl_compute3DColor( Color aMain, int nLight, int nMedium, int nDark )
+{
+    basegfx::BColor color = aMain.getBColor( );
+    basegfx::BColor hsl = basegfx::tools::rgb2hsl( color ); 
+
+    int nCoef = 0;
+    if ( hsl.getZ( ) >= 0.5 )
+        nCoef = nLight;
+    else if ( 0.5 > hsl.getZ() && hsl.getZ() >= 0.25 )
+        nCoef = nMedium;
+    else
+        nCoef = nDark;
+
+    double L = hsl.getZ() * 255.0 + nCoef;
+    hsl.setZ( L / 255.0 );
+    color = basegfx::tools::hsl2rgb( hsl );
+
+    return Color( color );
+}
+
+Color SvxBorderLine::threeDLightColor( Color aMain )
+{
+    // These values have been defined in an empirical way
+    return lcl_compute3DColor( aMain, 3, 40, 83 );
+}
+
+Color SvxBorderLine::threeDDarkColor( Color aMain )
+{
+    // These values have been defined in an empirical way
+    return lcl_compute3DColor( aMain, -85, -43, -1 );
+}
+
+Color SvxBorderLine::threeDMediumColor( Color aMain )
+{
+    // These values have been defined in an empirical way
+    return lcl_compute3DColor( aMain, -42, -0, 42 );
+}
+
+
+SvxBorderLine::SvxBorderLine( const Color *pCol, sal_uInt16 nOut, sal_uInt16 nIn, sal_uInt16 nDist,
+       SvxBorderStyle nStyle, bool bUseLeftTop, 
+       Color (*pColorOutFn)( Color ), Color (*pColorInFn)( Color ),
+       Color (*pColorGapFn)( Color ) )
 : nOutWidth( nOut )
 , nInWidth ( nIn )
 , nDistance( nDist )
+, m_nStyle( nStyle )
+, m_bUseLeftTop( bUseLeftTop )
+, m_pColorOutFn( pColorOutFn )
+, m_pColorInFn( pColorInFn )
+, m_pColorGapFn( pColorGapFn )
 {
 	if ( pCol )
 		aColor = *pCol;
 	nOutWidth = r.nOutWidth;
 	nInWidth = r.nInWidth;
 	nDistance = r.nDistance;
+    m_nStyle = r.m_nStyle;
+    m_bUseLeftTop = r.m_bUseLeftTop;
+    m_pColorOutFn = r.m_pColorOutFn;
+    m_pColorInFn = r.m_pColorInFn;
+    m_pColorGapFn = r.m_pColorGapFn;
 	return *this;
 }
 
 
 sal_Bool SvxBorderLine::operator==( const SvxBorderLine& rCmp ) const
 {
-	return ( ( aColor    == rCmp.GetColor() ) 	 &&
-			 ( nInWidth  == rCmp.GetInWidth() )  &&
-			 ( nOutWidth == rCmp.GetOutWidth() ) &&
-			 ( nDistance == rCmp.GetDistance() ) );
+    return ( ( aColor    == rCmp.aColor )            &&
+             ( nInWidth  == rCmp.GetInWidth() )      &&
+             ( nOutWidth == rCmp.GetOutWidth() )     &&
+             ( nDistance == rCmp.GetDistance() )     &&
+             ( m_nStyle == rCmp.GetStyle() )         &&
+             ( m_bUseLeftTop == rCmp.m_bUseLeftTop ) &&
+             ( m_pColorOutFn == rCmp.m_pColorOutFn ) &&
+             ( m_pColorInFn == rCmp.m_pColorInFn )   &&
+             ( m_pColorGapFn == rCmp.m_pColorGapFn ) );
+}
+
+void SvxBorderLine::SetStyle( SvxBorderStyle nNew )
+{
+    m_nStyle = nNew;
+    switch ( nNew )
+    {
+        case EMBOSSED:
+            m_pColorOutFn = threeDLightColor;
+            m_pColorInFn  = threeDDarkColor;
+            m_pColorGapFn = threeDMediumColor;
+            m_bUseLeftTop = true;
+            break;
+        case ENGRAVED:
+            m_pColorOutFn = threeDDarkColor;
+            m_pColorInFn  = threeDLightColor;
+            m_pColorGapFn = threeDMediumColor;
+            m_bUseLeftTop = true;
+            break;
+        case OUTSET:
+            m_pColorOutFn = lightColor;
+            m_pColorInFn  = darkColor;
+            m_bUseLeftTop = true;
+            m_pColorGapFn = NULL;
+            break;
+        case INSET:
+            m_pColorOutFn = darkColor;
+            m_pColorInFn  = lightColor;
+            m_bUseLeftTop = true;
+            m_pColorGapFn = NULL;
+            break;
+        default:
+            m_pColorOutFn = darkColor;
+            m_pColorInFn = darkColor;
+            m_bUseLeftTop = false;
+            m_pColorGapFn = NULL;
+            break;
+    }
+}
+
+Color SvxBorderLine::GetColorOut( bool bLeftOrTop ) const
+{
+    Color aResult = aColor;
+
+    if ( nInWidth > 0 && nOutWidth > 0 && m_pColorOutFn != NULL )
+    {
+        if ( !bLeftOrTop && m_bUseLeftTop )
+            aResult = (*m_pColorInFn)( aColor );
+        else
+            aResult = (*m_pColorOutFn)( aColor );
+    }
+
+    return aResult;
+}
+
+Color SvxBorderLine::GetColorIn( bool bLeftOrTop ) const
+{
+    Color aResult = aColor;
+
+    if ( nInWidth > 0 && nOutWidth > 0 && m_pColorInFn != NULL )
+    {
+        if ( !bLeftOrTop && m_bUseLeftTop )
+            aResult = (*m_pColorOutFn)( aColor );
+        else
+            aResult = (*m_pColorInFn)( aColor );
+    }
+
+    return aResult;
+}
+
+Color SvxBorderLine::GetColorGap( ) const
+{
+    Color aResult = aColor;
+
+    if ( nInWidth > 0 && nOutWidth > 0 && m_pColorGapFn != NULL )
+    {
+        aResult = (*m_pColorGapFn)( aColor );
+    }
+
+    return aResult;
 }
 
 // -----------------------------------------------------------------------
 }
 
 // -----------------------------------------------------------------------
-table::BorderLine SvxBoxItem::SvxLineToLine(const SvxBorderLine* pLine, sal_Bool bConvert)
+table::BorderLine2 SvxBoxItem::SvxLineToLine(const SvxBorderLine* pLine, sal_Bool bConvert)
 {
-	table::BorderLine aLine;
+	table::BorderLine2 aLine;
 	if(pLine)
 	{
 		aLine.Color			 = pLine->GetColor().GetColor() ;
         aLine.InnerLineWidth = sal_uInt16( bConvert ? TWIP_TO_MM100_UNSIGNED(pLine->GetInWidth() ): pLine->GetInWidth() );
         aLine.OuterLineWidth = sal_uInt16( bConvert ? TWIP_TO_MM100_UNSIGNED(pLine->GetOutWidth()): pLine->GetOutWidth() );
         aLine.LineDistance   = sal_uInt16( bConvert ? TWIP_TO_MM100_UNSIGNED(pLine->GetDistance()): pLine->GetDistance() );
+        aLine.LineStyle      = pLine->GetStyle( );
 	}
 	else
 		aLine.Color			 = aLine.InnerLineWidth = aLine.OuterLineWidth = aLine.LineDistance	 = 0;
 sal_Bool SvxBoxItem::QueryValue( uno::Any& rVal, BYTE nMemberId  ) const
 {
 	sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
-	table::BorderLine aRetLine;
+	table::BorderLine2 aRetLine;
 	sal_uInt16 nDist = 0;
 	sal_Bool bDistMember = sal_False;
 	nMemberId &= ~CONVERT_TWIPS;
 	rSvxLine.SetInWidth( sal_uInt16( bConvert ? MM100_TO_TWIP(rLine.InnerLineWidth) : rLine.InnerLineWidth  ));
 	rSvxLine.SetOutWidth( sal_uInt16( bConvert ? MM100_TO_TWIP(rLine.OuterLineWidth) : rLine.OuterLineWidth  ));
 	rSvxLine.SetDistance( sal_uInt16( bConvert ? MM100_TO_TWIP(rLine.LineDistance	)  : rLine.LineDistance	 ));
+
+    const table::BorderLine2& rLine2 = static_cast< const table::BorderLine2& >( rLine );
+    rSvxLine.SetStyle( ( SvxBorderStyle ) rLine2.LineStyle );
+
 	sal_Bool bRet = rLine.InnerLineWidth > 0 || rLine.OuterLineWidth > 0;
 	return bRet;
 }
                 // 4 Borders and 5 distances
 		        sal_Int32 nDist = 0;
 		        SvxBorderLine aLine;
-                table::BorderLine aBorderLine;
+                table::BorderLine2 aBorderLine;
                 if ( aSeq[0] >>= aBorderLine )
                 {
                     sal_Bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert);
         if( !rVal.hasValue() )
 			return sal_False;
 
-        table::BorderLine aBorderLine;
+        table::BorderLine2 aBorderLine;
         if( rVal >>= aBorderLine )
         {
             // usual struct
 sal_Bool SvxBoxInfoItem::QueryValue( uno::Any& rVal, BYTE nMemberId  ) const
 {
 	sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
-	table::BorderLine aRetLine;
+	table::BorderLine2 aRetLine;
     sal_Int16 nVal=0;
     sal_Bool bIntMember = sal_False;
 	nMemberId &= ~CONVERT_TWIPS;
             if (( rVal >>= aSeq ) && ( aSeq.getLength() == 5 ))
             {
                 // 2 BorderLines, flags, valid flags and distance
-                table::BorderLine aBorderLine;
+                table::BorderLine2 aBorderLine;
                 SvxBorderLine aLine;
                 sal_Int16 nFlags( 0 );
                 sal_Int32 nVal( 0 );
             if( !rVal.hasValue() )
                 return sal_False;
 
-            table::BorderLine aBorderLine;
+            table::BorderLine2 aBorderLine;
             if( rVal >>= aBorderLine )
             {
                 // usual struct
     sal_Int32 nVal = 0;
     if ( nMemId == 0 )
     {
-        table::BorderLine aLine;
+        table::BorderLine2 aLine;
         if ( rVal >>= aLine )
         {
             if ( !pLine )
             case MID_OUTER_WIDTH:   pLine->SetOutWidth((USHORT)nVal);   break;
             case MID_INNER_WIDTH:   pLine->SetInWidth((USHORT)nVal);   break;
             case MID_DISTANCE:      pLine->SetDistance((USHORT)nVal);   break;
+            case MID_LINE_STYLE:    pLine->SetStyle((SvxBorderStyle)nVal);   break;
             default:
                 DBG_ERROR( "Wrong MemberId" );
                 return sal_False;

File editeng/source/rtf/rtfitem.cxx

 			}
 			goto SETBORDERLINE;
 
-		case RTF_BRDRS:
 		case RTF_BRDRDOT:
-		case RTF_BRDRHAIR:
+            aBrd.SetStyle( DOTTED );
+            break;
 		case RTF_BRDRDASH:
+            aBrd.SetStyle( DASHED );
+            break;
+        case RTF_BRDRS:
+        case RTF_BRDRHAIR:
+            aBrd.SetStyle( SOLID );
 SETBORDERLINE:
 			SetBorderLine( nBorderTyp, aAttr, aBrd );
 			break;

File filter/inc/filter/msfilter/msdffimp.hxx

 	ULONG		nShapeId;
 	MSO_SPT		eShapeType;
 	MSO_LineStyle eLineStyle;	// Umrandungs-Arten
+    MSO_LineDashing eLineDashing;
 	BOOL		bDrawHell		:1;
 	BOOL		bHidden			:1;
 	BOOL		bReplaceByFly	:1;

File filter/source/msfilter/msdffimp.cxx

 							: (MSO_LineStyle)USHRT_MAX;
 		pTextImpRec->eLineStyle = pImpRec->eLineStyle;
 
+        pImpRec->eLineDashing = (MSO_LineDashing)GetPropertyValue( 
+                DFF_Prop_lineDashing, mso_lineSolid );
+        pTextImpRec->eLineDashing = pImpRec->eLineDashing;
+
 		if( pImpRec->nShapeId )
 		{
 			// Import-Record-Liste ergaenzen
       eShapeType( mso_sptNil )
 {
       eLineStyle      = mso_lineSimple; // GPF-Bug #66227#
+      eLineDashing    = mso_lineSolid;
       bDrawHell       = FALSE;
       bHidden         = FALSE;
 //	  bInGroup		  = FALSE;
       eShapeType( rCopy.eShapeType )
 {
     eLineStyle       = rCopy.eLineStyle; // GPF-Bug #66227#
+    eLineDashing     = rCopy.eLineDashing;
     bDrawHell        = rCopy.bDrawHell;
     bHidden          = rCopy.bHidden;
 //			bInGroup		 = rCopy.bInGroup;

File filter/source/xslt/export/uof/odf2uof_spreadsheet.xsl

 				<xsl:element name="uof:左">
 					<xsl:attribute name="uof:locID">u0057</xsl:attribute>
 					<xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
-					<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+					<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
 					<xsl:if test="$border!='none'">
 						<xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),$uofUnit)"/></xsl:attribute>
 						<xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
 				<xsl:element name="uof:上">
 					<xsl:attribute name="uof:locID">u0058</xsl:attribute>
 					<xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
-					<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+					<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
 					<xsl:if test="$border!='none'">
 						<xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),$uofUnit)"/></xsl:attribute>
 						<xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
 				<xsl:element name="uof:右">
 					<xsl:attribute name="uof:locID">u0059</xsl:attribute>
 					<xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
-					<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+					<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
 					<xsl:if test="$border!='none'">
 						<xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),$uofUnit)"/></xsl:attribute>
 						<xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
 				<xsl:element name="uof:下">
 					<xsl:attribute name="uof:locID">u0060</xsl:attribute>
 					<xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
-					<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+					<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
 					<xsl:if test="$border!='none'">
 						<xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),$uofUnit)"/></xsl:attribute>
 						<xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>

File filter/source/xslt/export/uof/odf2uof_text.xsl

 		<xsl:element name="uof:左">
 			<xsl:attribute name="uof:locID">u0057</xsl:attribute>
 			<xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
-			<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+			<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
 			<xsl:if test="$border!='none'">
 				<xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),substring($ooUnit,1,2))"/></xsl:attribute>
 				<xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
 		<xsl:element name="uof:上">
 			<xsl:attribute name="uof:locID">u0058</xsl:attribute>
 			<xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
-			<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+			<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
 			<xsl:if test="$border!='none'">
 				<xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),substring($ooUnit,1,2))"/></xsl:attribute>
 				<xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
 		<xsl:element name="uof:右">
 			<xsl:attribute name="uof:locID">u0059</xsl:attribute>
 			<xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
-			<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+			<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
 			<xsl:if test="$border!='none'">
 				<xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),substring($ooUnit,1,2))"/></xsl:attribute>
 				<xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
 		<xsl:element name="uof:下">
 			<xsl:attribute name="uof:locID">u0060</xsl:attribute>
 			<xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
-			<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+			<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
 			<xsl:if test="$border!='none'">
 				<xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),substring($ooUnit,1,2))"/></xsl:attribute>
 				<xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>

File offapi/com/sun/star/table/BorderLine.idl

 		double line (in 1/100 mm).
 	 */
 	short LineDistance;
-
 };
 
 //=============================================================================

File offapi/com/sun/star/table/makefile.mk

     AccessibleCellView.idl      \
     AccessibleTableView.idl	\
 	BorderLine.idl\
+    BorderLine2.idl\
+    BorderLineStyle.idl\
 	Cell.idl\
 	CellAddress.idl\
 	CellContentType.idl\

File oox/inc/oox/helper/helper.hxx

 const sal_Int32 API_RGB_BLACK               = 0x00000;  /// Black color for API calls.
 const sal_Int32 API_RGB_WHITE               = 0xFFFFF;  /// White color for API calls.
 
+const sal_Int16 API_LINE_SOLID              = 0;
+const sal_Int16 API_LINE_DOTTED             = 1;
+const sal_Int16 API_LINE_DASHED             = 2;
+
 const sal_Int16 API_LINE_NONE               = 0;
 const sal_Int16 API_LINE_HAIR               = 2;
 const sal_Int16 API_LINE_THIN               = 35;

File oox/inc/oox/xls/stylesbuffer.hxx

 #include <com/sun/star/table/CellHoriJustify.hpp>
 #include <com/sun/star/table/CellOrientation.hpp>
 #include <com/sun/star/table/CellVertJustify.hpp>
-#include <com/sun/star/table/TableBorder.hpp>
+#include <com/sun/star/table/BorderLine2.hpp>
 #include "oox/helper/containerhelper.hxx"
 #include "oox/drawingml/color.hxx"
 #include "oox/xls/numberformatsbuffer.hxx"
 /** Contains API attributes of a complete cell border. */
 struct ApiBorderData
 {
-    typedef ::com::sun::star::table::TableBorder    ApiTableBorder;
-    typedef ::com::sun::star::table::BorderLine     ApiBorderLine;
+    typedef ::com::sun::star::table::BorderLine2     ApiBorderLine;
 
-    ApiTableBorder      maBorder;           /// Left/right/top/bottom line format.
+    ApiBorderLine       maLeft;             /// Left line format
+    ApiBorderLine       maRight;            /// Right line format
+    ApiBorderLine       maTop;              /// Top line format
+    ApiBorderLine       maBottom;           /// Bottom line format
     ApiBorderLine       maTLtoBR;           /// Diagonal top-left to bottom-right line format.
     ApiBorderLine       maBLtoTR;           /// Diagonal bottom-left to top-right line format.
     bool                mbBorderUsed;       /// True = left/right/top/bottom line format used.
 
     /** Converts border line data to an API struct, returns true, if the line is marked as used. */
     bool                convertBorderLine(
-                            ::com::sun::star::table::BorderLine& rBorderLine,
+                            ::com::sun::star::table::BorderLine2& rBorderLine,
                             const BorderLineModel& rModel );
 
 private:

File oox/source/drawingml/table/tablecell.cxx

 #include <com/sun/star/beans/XMultiPropertySet.hpp>
 #include <com/sun/star/table/XTable.hpp>
 #include <com/sun/star/table/XMergeableCellRange.hpp>
-#include <com/sun/star/table/BorderLine.hpp>
+#include <com/sun/star/table/BorderLine2.hpp>
 #include <com/sun/star/drawing/LineStyle.hpp>
 #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
 #include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::beans;
-using ::com::sun::star::table::BorderLine;
+using ::com::sun::star::table::BorderLine2;
 using ::com::sun::star::drawing::LineStyle;
 
 namespace oox { namespace drawingml { namespace table {
         Reference< XPropertySet >& rxPropSet, oox::drawingml::LineProperties& rLineProperties,
         sal_Int32 nPropId )
 {
-    BorderLine aBorderLine( 0, 0, 0, 0 );
+    BorderLine2 aBorderLine( 0, 0, 0, 0, API_LINE_SOLID );
     if( rLineProperties.maLineFill.moFillType.differsFrom( XML_noFill ) )
     {
         Color aColor = rLineProperties.maLineFill.getBestSolidColor();

File oox/source/drawingml/table/tableproperties.cxx

 #include <com/sun/star/beans/XMultiPropertySet.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/table/XMergeableCellRange.hpp>
-#include <com/sun/star/table/BorderLine.hpp>
+#include <com/sun/star/table/BorderLine2.hpp>
 #include "oox/core/namespaces.hxx"
 #include "oox/core/xmlfilterbase.hxx"
 #include "oox/helper/propertyset.hxx"

File oox/source/drawingml/table/tablerow.cxx

 #include "oox/helper/propertyset.hxx"
 #include <com/sun/star/table/XTable.hpp>
 #include <com/sun/star/table/XMergeableCellRange.hpp>
-#include <com/sun/star/table/BorderLine.hpp>
+#include <com/sun/star/table/BorderLine2.hpp>
 
 using rtl::OUString;
 using namespace ::oox::core;

File oox/source/xls/stylesbuffer.cxx

 using ::com::sun::star::awt::XDevice;
 using ::com::sun::star::awt::XFont2;
 using ::com::sun::star::table::BorderLine;
+using ::com::sun::star::table::BorderLine2;
 using ::com::sun::star::text::XText;
 using ::com::sun::star::style::XStyle;
 using ::oox::core::FilterBase;
     return rBorderLine.OuterLineWidth + rBorderLine.LineDistance + rBorderLine.InnerLineWidth;
 }
 
-const BorderLine* lclGetThickerLine( const BorderLine& rBorderLine1, sal_Bool bValid1, const BorderLine& rBorderLine2, sal_Bool bValid2 )
+const BorderLine2* lclGetThickerLine( const BorderLine2& rBorderLine1, sal_Bool bValid1, const BorderLine2& rBorderLine2, sal_Bool bValid2 )
 {
     if( bValid1 && bValid2 )
         return (lclGetBorderLineWidth( rBorderLine1 ) < lclGetBorderLineWidth( rBorderLine2 )) ? &rBorderLine2 : &rBorderLine1;
     maApiData.mbBorderUsed = maModel.maLeft.mbUsed || maModel.maRight.mbUsed || maModel.maTop.mbUsed || maModel.maBottom.mbUsed;
     maApiData.mbDiagUsed   = maModel.maDiagonal.mbUsed;
 
-    maApiData.maBorder.IsLeftLineValid   = convertBorderLine( maApiData.maBorder.LeftLine,   maModel.maLeft );
-    maApiData.maBorder.IsRightLineValid  = convertBorderLine( maApiData.maBorder.RightLine,  maModel.maRight );
-    maApiData.maBorder.IsTopLineValid    = convertBorderLine( maApiData.maBorder.TopLine,    maModel.maTop );
-    maApiData.maBorder.IsBottomLineValid = convertBorderLine( maApiData.maBorder.BottomLine, maModel.maBottom );
-
-    if( !mbDxf )
-    {
-        maApiData.maBorder.IsVerticalLineValid = maApiData.maBorder.IsLeftLineValid || maApiData.maBorder.IsRightLineValid;
-        if( const BorderLine* pVertLine = lclGetThickerLine( maApiData.maBorder.LeftLine, maApiData.maBorder.IsLeftLineValid, maApiData.maBorder.RightLine, maApiData.maBorder.IsRightLineValid ) )
-            maApiData.maBorder.VerticalLine = *pVertLine;
-
-        maApiData.maBorder.IsHorizontalLineValid = maApiData.maBorder.IsTopLineValid || maApiData.maBorder.IsBottomLineValid;
-        if( const BorderLine* pHorLine = lclGetThickerLine( maApiData.maBorder.TopLine, maApiData.maBorder.IsTopLineValid, maApiData.maBorder.BottomLine, maApiData.maBorder.IsBottomLineValid ) )
-            maApiData.maBorder.HorizontalLine = *pHorLine;
-    }
+    convertBorderLine( maApiData.maLeft,   maModel.maLeft );
+    convertBorderLine( maApiData.maRight,  maModel.maRight );
+    convertBorderLine( maApiData.maTop,    maModel.maTop );
+    convertBorderLine( maApiData.maBottom, maModel.maBottom );
 
     if( maModel.mbDiagTLtoBR )
         convertBorderLine( maApiData.maTLtoBR, maModel.maDiagonal );
 void Border::writeToPropertyMap( PropertyMap& rPropMap ) const
 {
     if( maApiData.mbBorderUsed )
-        rPropMap[ PROP_TableBorder ] <<= maApiData.maBorder;
+    {
+        rPropMap[ PROP_LeftBorder ]   <<= maApiData.maLeft;
+        rPropMap[ PROP_RightBorder ]  <<= maApiData.maRight;
+        rPropMap[ PROP_TopBorder ]    <<= maApiData.maTop;
+        rPropMap[ PROP_BottomBorder ] <<= maApiData.maBottom;
+    }
     if( maApiData.mbDiagUsed )
     {
         rPropMap[ PROP_DiagonalTLBR ] <<= maApiData.maTLtoBR;
     return 0;
 }
 
-bool Border::convertBorderLine( BorderLine& rBorderLine, const BorderLineModel& rModel )
+bool Border::convertBorderLine( BorderLine2& rBorderLine, const BorderLineModel& rModel )
 {
     rBorderLine.Color = rModel.maColor.getColor( getBaseFilter(), API_RGB_BLACK );
     switch( rModel.mnStyle )
     {
         case XML_dashDot:           lclSetBorderLineWidth( rBorderLine, API_LINE_THIN );    break;
         case XML_dashDotDot:        lclSetBorderLineWidth( rBorderLine, API_LINE_THIN );    break;
-        case XML_dashed:            lclSetBorderLineWidth( rBorderLine, API_LINE_THIN );    break;
-        case XML_dotted:            lclSetBorderLineWidth( rBorderLine, API_LINE_THIN );    break;
+        case XML_dashed:            
+        {
+                                    lclSetBorderLineWidth( rBorderLine, API_LINE_THIN );
+                                    rBorderLine.LineStyle = API_LINE_DASHED;
+                                    break;
+        }
+        case XML_dotted:            
+        {
+                                    lclSetBorderLineWidth( rBorderLine, API_LINE_THIN );
+                                    rBorderLine.LineStyle = API_LINE_DOTTED;
+                                    break;
+        }
         case XML_double:            lclSetBorderLineWidth( rBorderLine, API_LINE_THIN, API_LINE_THIN, API_LINE_THIN ); break;
         case XML_hair:              lclSetBorderLineWidth( rBorderLine, API_LINE_HAIR );    break;
         case XML_medium:            lclSetBorderLineWidth( rBorderLine, API_LINE_MEDIUM );  break;

File sc/source/filter/excel/xestyle.cxx

         else if( nOuterWidth > DEF_LINE_WIDTH_2 )
             rnXclLine = EXC_LINE_THICK;
         else if( nOuterWidth > DEF_LINE_WIDTH_1 )
+        {
             rnXclLine = EXC_LINE_MEDIUM;
-        else if( nOuterWidth > DEF_LINE_WIDTH_0 )
+            if ( pLine->GetStyle( ) == DASHED )
+                rnXclLine = EXC_LINE_MEDIUMDASHED;
+        }
+        else if( nOuterWidth > DEF_LINE_WIDTH_0 ) 
+        {
             rnXclLine = EXC_LINE_THIN;
+            switch ( pLine->GetStyle( ) )
+            {
+                case DASHED:
+                    rnXclLine = EXC_LINE_DASHED;
+                    break;
+                case DOTTED:
+                    rnXclLine = EXC_LINE_DOTTED;
+                    break;
+                default:
+                    break;
+            }
+        }
         else if( nOuterWidth > 0 )
             rnXclLine = EXC_LINE_HAIR;
         else
         case EXC_LINE_THICK:    return "thick";
         case EXC_LINE_DOUBLE:   return "double";
         case EXC_LINE_HAIR:     return "hair";
+        case EXC_LINE_DOTTED:     return "dotted";
+        case EXC_LINE_DASHED:     return "dashed";
+        case EXC_LINE_MEDIUMDASHED:     return "mediumdashed";
     }
     return "*unknown*";
 }

File sc/source/filter/excel/xistyle.cxx

 /** Converts the passed line style to a SvxBorderLine, or returns false, if style is "no line". */
 bool lclConvertBorderLine( SvxBorderLine& rLine, const XclImpPalette& rPalette, sal_uInt8 nXclLine, sal_uInt16 nXclColor )
 {
-    static const sal_uInt16 ppnLineParam[][ 3 ] =
+    static const sal_uInt16 ppnLineParam[][ 4 ] =
     {
-        //  outer width,        inner width,        distance
-        {   0,                  0,                  0 },                // 0 = none
-        {   DEF_LINE_WIDTH_1,   0,                  0 },                // 1 = thin
-        {   DEF_LINE_WIDTH_2,   0,                  0 },                // 2 = medium
-        {   DEF_LINE_WIDTH_1,   0,                  0 },                // 3 = dashed
-        {   DEF_LINE_WIDTH_0,   0,                  0 },                // 4 = dotted
-        {   DEF_LINE_WIDTH_3,   0,                  0 },                // 5 = thick
-        {   DEF_LINE_WIDTH_1,   DEF_LINE_WIDTH_1,   DEF_LINE_WIDTH_1 }, // 6 = double
-        {   DEF_LINE_WIDTH_0,   0,                  0 },                // 7 = hair
-        {   DEF_LINE_WIDTH_2,   0,                  0 },                // 8 = med dash
-        {   DEF_LINE_WIDTH_1,   0,                  0 },                // 9 = thin dashdot
-        {   DEF_LINE_WIDTH_2,   0,                  0 },                // A = med dashdot
-        {   DEF_LINE_WIDTH_1,   0,                  0 },                // B = thin dashdotdot
-        {   DEF_LINE_WIDTH_2,   0,                  0 },                // C = med dashdotdot
-        {   DEF_LINE_WIDTH_2,   0,                  0 }                 // D = med slant dashdot
+        //  outer width,        inner width,        distance    type
+        {   0,                  0,                  0,          SOLID },                // 0 = none
+        {   DEF_LINE_WIDTH_1,   0,                  0,          SOLID },                // 1 = thin
+        {   DEF_LINE_WIDTH_2,   0,                  0,          SOLID },                // 2 = medium
+        {   DEF_LINE_WIDTH_1,   0,                  0,          DASHED },               // 3 = dashed
+        {   DEF_LINE_WIDTH_1,   0,                  0,          DOTTED },               // 4 = dotted
+        {   DEF_LINE_WIDTH_3,   0,                  0,          SOLID },                // 5 = thick
+        {   DEF_LINE_WIDTH_1,   DEF_LINE_WIDTH_1,   DEF_LINE_WIDTH_1 },                 // 6 = double
+        {   DEF_LINE_WIDTH_0,   0,                  0,          SOLID },                // 7 = hair
+        {   DEF_LINE_WIDTH_2,   0,                  0,          DASHED },               // 8 = med dash
+        {   DEF_LINE_WIDTH_1,   0,                  0,          SOLID },                // 9 = thin dashdot
+        {   DEF_LINE_WIDTH_2,   0,                  0,          SOLID },                // A = med dashdot
+        {   DEF_LINE_WIDTH_1,   0,                  0,          SOLID },                // B = thin dashdotdot
+        {   DEF_LINE_WIDTH_2,   0,                  0,          SOLID },                // C = med dashdotdot
+        {   DEF_LINE_WIDTH_2,   0,                  0,          SOLID }                 // D = med slant dashdot
     };
 
     if( nXclLine == EXC_LINE_NONE )
     rLine.SetOutWidth( ppnLineParam[ nXclLine ][ 0 ] );
     rLine.SetInWidth(  ppnLineParam[ nXclLine ][ 1 ] );
     rLine.SetDistance( ppnLineParam[ nXclLine ][ 2 ] );
+    rLine.SetStyle( (SvxBorderStyle)ppnLineParam[ nXclLine ][ 3 ] );
     return true;
 }
 

File sc/source/filter/html/htmlexp.cxx

 		// thickness
 		int nWidth = pLine->GetOutWidth();
 		int nPxWidth = ( nWidth > 0 )? std::max( int( nWidth / TWIPS_PER_PIXEL ), 1 ): 0;
-		(rOut += ByteString::CreateFromInt32( nPxWidth )) += "px solid #";
+        (rOut += ByteString::CreateFromInt32( nPxWidth )) += "px ";
+        switch ( pLine->GetStyle() )
+        {
+            case DOTTED:    rOut += "dotted"; break;
+            case DASHED:    rOut += "dashed"; break;
+            default:        rOut += "solid";
+        }
+        rOut += " #";
 
 		// color
 		char hex[7];

File sc/source/filter/inc/xlstyle.hxx

 const sal_uInt8 EXC_LINE_NONE               = 0x00;
 const sal_uInt8 EXC_LINE_THIN               = 0x01;
 const sal_uInt8 EXC_LINE_MEDIUM             = 0x02;
+const sal_uInt8 EXC_LINE_DASHED             = 0x03;
+const sal_uInt8 EXC_LINE_DOTTED             = 0x04;
 const sal_uInt8 EXC_LINE_THICK              = 0x05;
 const sal_uInt8 EXC_LINE_DOUBLE             = 0x06;
 const sal_uInt8 EXC_LINE_HAIR               = 0x07;
+const sal_uInt8 EXC_LINE_MEDIUMDASHED       = 0x08;
 
 // Background patterns --------------------------------------------------------
 

File sc/source/ui/unoobj/cellsuno.cxx

 #include <com/sun/star/table/CellVertJustify.hpp>
 #include <com/sun/star/table/ShadowFormat.hpp>
 #include <com/sun/star/table/TableBorder.hpp>
+#include <com/sun/star/table/BorderLine2.hpp>
 #include <com/sun/star/sheet/CellFlags.hpp>
 #include <com/sun/star/sheet/FormulaResult.hpp>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 	{
         {MAP_CHAR_LEN(SC_UNONAME_ABSNAME),	SC_WID_UNO_ABSNAME,	&getCppuType((rtl::OUString*)0),		0 | beans::PropertyAttribute::READONLY, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_ASIANVERT),ATTR_VERTICAL_ASIAN,&getBooleanCppuType(),					0, 0 },
-		{MAP_CHAR_LEN(SC_UNONAME_BOTTBORDER),ATTR_BORDER,		&::getCppuType((const table::BorderLine*)0), 0, BOTTOM_BORDER | CONVERT_TWIPS },
+        {MAP_CHAR_LEN(SC_UNONAME_BOTTBORDER),ATTR_BORDER,		&::getCppuType((const table::BorderLine2*)0), 0, BOTTOM_BORDER | CONVERT_TWIPS },
 		{MAP_CHAR_LEN(SC_UNONAME_CELLBACK),	ATTR_BACKGROUND,	&getCppuType((sal_Int32*)0),			0, MID_BACK_COLOR },
 		{MAP_CHAR_LEN(SC_UNONAME_CELLPRO),	ATTR_PROTECTION,	&getCppuType((util::CellProtection*)0),	0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_CELLSTYL),	SC_WID_UNO_CELLSTYL,&getCppuType((rtl::OUString*)0),		0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_CONDFMT),	SC_WID_UNO_CONDFMT,	&getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_CONDLOC),	SC_WID_UNO_CONDLOC,	&getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_CONDXML),	SC_WID_UNO_CONDXML,	&getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
-		{MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_BLTR), ATTR_BORDER_BLTR, &::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
-		{MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_TLBR), ATTR_BORDER_TLBR, &::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
+		{MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_BLTR), ATTR_BORDER_BLTR, &::getCppuType((const table::BorderLine2*)0), 0, 0 | CONVERT_TWIPS },
+		{MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_TLBR), ATTR_BORDER_TLBR, &::getCppuType((const table::BorderLine2*)0), 0, 0 | CONVERT_TWIPS },
         {MAP_CHAR_LEN(SC_UNONAME_CELLHJUS),	ATTR_HOR_JUSTIFY,	&getCppuType((table::CellHoriJustify*)0), 0, MID_HORJUST_HORJUST },
 		{MAP_CHAR_LEN(SC_UNONAME_CELLTRAN),	ATTR_BACKGROUND,	&getBooleanCppuType(),					0, MID_GRAPHIC_TRANSPARENT },
 		{MAP_CHAR_LEN(SC_UNONAME_WRAP),		ATTR_LINEBREAK,		&getBooleanCppuType(),					0, 0 },
-		{MAP_CHAR_LEN(SC_UNONAME_LEFTBORDER),ATTR_BORDER,		&::getCppuType((const table::BorderLine*)0), 0, LEFT_BORDER | CONVERT_TWIPS },
+		{MAP_CHAR_LEN(SC_UNONAME_LEFTBORDER),ATTR_BORDER,		&::getCppuType((const table::BorderLine2*)0), 0, LEFT_BORDER | CONVERT_TWIPS },
 		{MAP_CHAR_LEN(SC_UNONAME_NUMFMT),	ATTR_VALUE_FORMAT,	&getCppuType((sal_Int32*)0),			0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_NUMRULES),	SC_WID_UNO_NUMRULES,&getCppuType((const uno::Reference<container::XIndexReplace>*)0), 0, 0 },
         {MAP_CHAR_LEN(SC_UNONAME_CELLORI),  ATTR_STACKED,       &getCppuType((table::CellOrientation*)0), 0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_PLMARGIN),	ATTR_MARGIN,		&getCppuType((sal_Int32*)0),			0, MID_MARGIN_L_MARGIN  | CONVERT_TWIPS },
 		{MAP_CHAR_LEN(SC_UNONAME_PRMARGIN),	ATTR_MARGIN,		&getCppuType((sal_Int32*)0),			0, MID_MARGIN_R_MARGIN  | CONVERT_TWIPS },
 		{MAP_CHAR_LEN(SC_UNONAME_PTMARGIN),	ATTR_MARGIN,		&getCppuType((sal_Int32*)0),			0, MID_MARGIN_UP_MARGIN | CONVERT_TWIPS },
-		{MAP_CHAR_LEN(SC_UNONAME_RIGHTBORDER),ATTR_BORDER,		&::getCppuType((const table::BorderLine*)0), 0, RIGHT_BORDER | CONVERT_TWIPS },
+		{MAP_CHAR_LEN(SC_UNONAME_RIGHTBORDER),ATTR_BORDER,		&::getCppuType((const table::BorderLine2*)0), 0, RIGHT_BORDER | CONVERT_TWIPS },
 		{MAP_CHAR_LEN(SC_UNONAME_ROTANG),	ATTR_ROTATE_VALUE,	&getCppuType((sal_Int32*)0),			0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_ROTREF),	ATTR_ROTATE_MODE,	&getCppuType((table::CellVertJustify*)0), 0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_SHADOW),	ATTR_SHADOW,		&getCppuType((table::ShadowFormat*)0),	0, 0 | CONVERT_TWIPS },
         {MAP_CHAR_LEN(SC_UNONAME_SHRINK_TO_FIT), ATTR_SHRINKTOFIT, &getBooleanCppuType(),			    0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_TBLBORD),	SC_WID_UNO_TBLBORD,	&getCppuType((table::TableBorder*)0),	0, 0 | CONVERT_TWIPS },
-		{MAP_CHAR_LEN(SC_UNONAME_TOPBORDER),ATTR_BORDER,		&::getCppuType((const table::BorderLine*)0), 0, TOP_BORDER | CONVERT_TWIPS },
+		{MAP_CHAR_LEN(SC_UNONAME_TOPBORDER),ATTR_BORDER,		&::getCppuType((const table::BorderLine2*)0), 0, TOP_BORDER | CONVERT_TWIPS },
 		{MAP_CHAR_LEN(SC_UNONAME_USERDEF),	ATTR_USERDEF,		&getCppuType((uno::Reference<container::XNameContainer>*)0), 0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_VALIDAT),	SC_WID_UNO_VALIDAT,	&getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_VALILOC),	SC_WID_UNO_VALILOC,	&getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
 	{
         {MAP_CHAR_LEN(SC_UNONAME_ABSNAME),	SC_WID_UNO_ABSNAME,	&getCppuType((rtl::OUString*)0),		0 | beans::PropertyAttribute::READONLY, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_ASIANVERT),ATTR_VERTICAL_ASIAN,&getBooleanCppuType(),					0, 0 },
-		{MAP_CHAR_LEN(SC_UNONAME_BOTTBORDER),ATTR_BORDER,		&::getCppuType((const table::BorderLine*)0), 0, BOTTOM_BORDER | CONVERT_TWIPS },
+        {MAP_CHAR_LEN(SC_UNONAME_BOTTBORDER),ATTR_BORDER,		&::getCppuType((const table::BorderLine2*)0), 0, BOTTOM_BORDER | CONVERT_TWIPS },
 		{MAP_CHAR_LEN(SC_UNONAME_CELLBACK),	ATTR_BACKGROUND,	&getCppuType((sal_Int32*)0),			0, MID_BACK_COLOR },
 		{MAP_CHAR_LEN(SC_UNONAME_CELLPRO),	ATTR_PROTECTION,	&getCppuType((util::CellProtection*)0),	0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_CELLSTYL),	SC_WID_UNO_CELLSTYL,&getCppuType((rtl::OUString*)0),		0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_CONDFMT),	SC_WID_UNO_CONDFMT,	&getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_CONDLOC),	SC_WID_UNO_CONDLOC,	&getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_CONDXML),	SC_WID_UNO_CONDXML,	&getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
-		{MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_BLTR), ATTR_BORDER_BLTR, &::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
-		{MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_TLBR), ATTR_BORDER_TLBR, &::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
+		{MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_BLTR), ATTR_BORDER_BLTR, &::getCppuType((const table::BorderLine2*)0), 0, 0 | CONVERT_TWIPS },
+		{MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_TLBR), ATTR_BORDER_TLBR, &::getCppuType((const table::BorderLine2*)0), 0, 0 | CONVERT_TWIPS },
 		{MAP_CHAR_LEN(SC_UNONAME_CELLHJUS),	ATTR_HOR_JUSTIFY,	&getCppuType((table::CellHoriJustify*)0),	0, MID_HORJUST_HORJUST },
 		{MAP_CHAR_LEN(SC_UNONAME_CELLTRAN),	ATTR_BACKGROUND,	&getBooleanCppuType(),					0, MID_GRAPHIC_TRANSPARENT },
 		{MAP_CHAR_LEN(SC_UNONAME_WRAP),		ATTR_LINEBREAK,		&getBooleanCppuType(),					0, 0 },
-		{MAP_CHAR_LEN(SC_UNONAME_LEFTBORDER),ATTR_BORDER,		&::getCppuType((const table::BorderLine*)0), 0, LEFT_BORDER | CONVERT_TWIPS },
+		{MAP_CHAR_LEN(SC_UNONAME_LEFTBORDER),ATTR_BORDER,		&::getCppuType((const table::BorderLine2*)0), 0, LEFT_BORDER | CONVERT_TWIPS },
 		{MAP_CHAR_LEN(SC_UNONAME_NUMFMT),	ATTR_VALUE_FORMAT,	&getCppuType((sal_Int32*)0),			0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_NUMRULES),	SC_WID_UNO_NUMRULES,&getCppuType((const uno::Reference<container::XIndexReplace>*)0), 0, 0 },
         {MAP_CHAR_LEN(SC_UNONAME_CELLORI),  ATTR_STACKED,       &getCppuType((table::CellOrientation*)0), 0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_PRMARGIN),	ATTR_MARGIN,		&getCppuType((sal_Int32*)0),			0, MID_MARGIN_R_MARGIN  | CONVERT_TWIPS },
 		{MAP_CHAR_LEN(SC_UNONAME_PTMARGIN),	ATTR_MARGIN,		&getCppuType((sal_Int32*)0),			0, MID_MARGIN_UP_MARGIN | CONVERT_TWIPS },
 		{MAP_CHAR_LEN(SC_UNONAME_POS),		SC_WID_UNO_POS,		&getCppuType((awt::Point*)0),			0 | beans::PropertyAttribute::READONLY, 0 },
-		{MAP_CHAR_LEN(SC_UNONAME_RIGHTBORDER),ATTR_BORDER,		&::getCppuType((const table::BorderLine*)0), 0, RIGHT_BORDER | CONVERT_TWIPS },
+		{MAP_CHAR_LEN(SC_UNONAME_RIGHTBORDER),ATTR_BORDER,		&::getCppuType((const table::BorderLine2*)0), 0, RIGHT_BORDER | CONVERT_TWIPS },
 		{MAP_CHAR_LEN(SC_UNONAME_ROTANG),	ATTR_ROTATE_VALUE,	&getCppuType((sal_Int32*)0),			0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_ROTREF),	ATTR_ROTATE_MODE,	&getCppuType((table::CellVertJustify*)0), 0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_SHADOW),	ATTR_SHADOW,		&getCppuType((table::ShadowFormat*)0),	0, 0 | CONVERT_TWIPS },
         {MAP_CHAR_LEN(SC_UNONAME_SHRINK_TO_FIT), ATTR_SHRINKTOFIT, &getBooleanCppuType(),			    0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_SIZE),		SC_WID_UNO_SIZE,	&getCppuType((awt::Size*)0),			0 | beans::PropertyAttribute::READONLY, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_TBLBORD),	SC_WID_UNO_TBLBORD,	&getCppuType((table::TableBorder*)0),	0, 0 | CONVERT_TWIPS },
-		{MAP_CHAR_LEN(SC_UNONAME_TOPBORDER),ATTR_BORDER,		&::getCppuType((const table::BorderLine*)0), 0, TOP_BORDER | CONVERT_TWIPS },
+		{MAP_CHAR_LEN(SC_UNONAME_TOPBORDER),ATTR_BORDER,		&::getCppuType((const table::BorderLine2*)0), 0, TOP_BORDER | CONVERT_TWIPS },
 		{MAP_CHAR_LEN(SC_UNONAME_USERDEF),	ATTR_USERDEF,		&getCppuType((uno::Reference<container::XNameContainer>*)0), 0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_VALIDAT),	SC_WID_UNO_VALIDAT,	&getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_VALILOC),	SC_WID_UNO_VALILOC,	&getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
 	{
         {MAP_CHAR_LEN(SC_UNONAME_ABSNAME),	SC_WID_UNO_ABSNAME,	&getCppuType((rtl::OUString*)0),		0 | beans::PropertyAttribute::READONLY, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_ASIANVERT),ATTR_VERTICAL_ASIAN,&getBooleanCppuType(),					0, 0 },
-		{MAP_CHAR_LEN(SC_UNONAME_BOTTBORDER),ATTR_BORDER,		&::getCppuType((const table::BorderLine*)0), 0, BOTTOM_BORDER | CONVERT_TWIPS },
+        {MAP_CHAR_LEN(SC_UNONAME_BOTTBORDER),ATTR_BORDER,		&::getCppuType((const table::BorderLine2*)0), 0, BOTTOM_BORDER | CONVERT_TWIPS },
 		{MAP_CHAR_LEN(SC_UNONAME_CELLBACK),	ATTR_BACKGROUND,	&getCppuType((sal_Int32*)0),			0, MID_BACK_COLOR },
 		{MAP_CHAR_LEN(SC_UNONAME_CELLPRO),	ATTR_PROTECTION,	&getCppuType((util::CellProtection*)0),	0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_CELLSTYL),	SC_WID_UNO_CELLSTYL,&getCppuType((rtl::OUString*)0),		0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_CONDFMT),	SC_WID_UNO_CONDFMT,	&getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_CONDLOC),	SC_WID_UNO_CONDLOC,	&getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_CONDXML),	SC_WID_UNO_CONDXML,	&getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
-		{MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_BLTR), ATTR_BORDER_BLTR, &::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
-		{MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_TLBR), ATTR_BORDER_TLBR, &::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
+		{MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_BLTR), ATTR_BORDER_BLTR, &::getCppuType((const table::BorderLine2*)0), 0, 0 | CONVERT_TWIPS },