[Libreoffice-commits] core.git: Branch 'feature/calc-cell-borders' - 4 commits - drawinglayer/source sc/source svtools/source

Kohei Yoshida kohei.yoshida at collabora.com
Tue Jan 14 15:44:24 PST 2014


 drawinglayer/source/primitive2d/borderlineprimitive2d.cxx |   26 ++++++++-
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx   |    2 
 sc/source/filter/excel/xistyle.cxx                        |    2 
 svtools/source/control/ctrlbox.cxx                        |   39 +++++++-------
 4 files changed, 47 insertions(+), 22 deletions(-)

New commits:
commit 1e635b21d8c3ab1bd21fb9d59625e71a1d185362
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Jan 14 18:44:11 2014 -0500

    Map Excel's normal dashed line to our FINE_DASHED.
    
    Excel's medium dashed maps better with our regular DASHED pattern.
    
    Change-Id: I9c7161ced9592b6c6617d6edbc616e0b1c3dc1e8

diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 54dade2..c569ce8 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -900,7 +900,7 @@ bool lclConvertBorderLine( ::editeng::SvxBorderLine& rLine, const XclImpPalette&
         {   0,                  table::BorderLineStyle::SOLID },  // 0 = none
         {   EXC_BORDER_THIN,    table::BorderLineStyle::SOLID },  // 1 = thin
         {   EXC_BORDER_MEDIUM,  table::BorderLineStyle::SOLID },  // 2 = medium
-        {   EXC_BORDER_THIN,    table::BorderLineStyle::DASHED }, // 3 = dashed
+        {   EXC_BORDER_THIN,    table::BorderLineStyle::FINE_DASHED }, // 3 = dashed
         {   EXC_BORDER_THIN,    table::BorderLineStyle::DOTTED }, // 4 = dotted
         {   EXC_BORDER_THICK,   table::BorderLineStyle::SOLID },  // 5 = thick
         {   EXC_BORDER_THIN,    table::BorderLineStyle::DOUBLE }, // 6 = double
commit 9b7f4dc76faa9e20cbecb3d1fc40cb94fec05d6f
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Jan 14 18:42:54 2014 -0500

    More fine-tuned stroke patterns.
    
    Only the pixel map mode is visually inspected.
    
    Change-Id: Ia8ac978a0d3049d7e7162f1157822b85d475dfdf

diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 1575103..0ba3bc6 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -594,46 +594,51 @@ namespace svtools
                 if ( eUnit == MAP_TWIP )
                 {
                     aPattern.push_back( 30.0 );
-                    aPattern.push_back( 110.0 );
+                    aPattern.push_back( 60.0 );
                 }
                 else if ( eUnit == MAP_100TH_MM )
                 {
-                    aPattern.push_back( 50 );
-                    aPattern.push_back( 200 );
+                    aPattern.push_back( 50.0 );
+                    aPattern.push_back( 100.0 );
                 }
                 else if ( eUnit == MAP_PIXEL )
                 {
-                    aPattern.push_back( 1.0 );
-                    aPattern.push_back( 3.0 );
+                    aPattern.push_back( 1.0 ); // line
+                    aPattern.push_back( 2.0 ); // blank
                 }
                 break;
             case table::BorderLineStyle::DASHED:
                 if ( eUnit == MAP_TWIP )
                 {
-                    aPattern.push_back( 110 );
-                    aPattern.push_back( 110 );
+                    aPattern.push_back( 120.0 );
+                    aPattern.push_back( 40.0 );
                 }
                 else if ( eUnit == MAP_100TH_MM )
                 {
-                    aPattern.push_back( 200 );
-                    aPattern.push_back( 200 );
+                    aPattern.push_back( 150.0 );
+                    aPattern.push_back( 50.0 );
                 }
                 else if ( eUnit == MAP_PIXEL )
                 {
-                    aPattern.push_back( 10 );
-                    aPattern.push_back( 20 );
+                    aPattern.push_back( 9.0 );
+                    aPattern.push_back( 3.0 );
                 }
                 break;
             case table::BorderLineStyle::FINE_DASHED:
-                if ( eUnit == MAP_PIXEL )
+                if ( eUnit == MAP_TWIP )
                 {
-                    aPattern.push_back( 8 );
-                    aPattern.push_back( 2 );
+                    aPattern.push_back( 60.0 );
+                    aPattern.push_back( 40.0 );
                 }
-                else if ( eUnit == MAP_TWIP )
+                else if ( eUnit == MAP_100TH_MM )
                 {
-                    aPattern.push_back( 120.0 );
-                    aPattern.push_back( 30.0 );
+                    aPattern.push_back( 75.0 );
+                    aPattern.push_back( 50.0 );
+                }
+                else if ( eUnit == MAP_PIXEL )
+                {
+                    aPattern.push_back( 3.0 );
+                    aPattern.push_back( 2.0 );
                 }
                 break;
             default:
commit 773aa63cad623c9dca691b78add49f47fcf46789
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Jan 14 18:40:10 2014 -0500

    Use hairlines judiciously to draw very thin patterned strokes correctly.
    
    This prevents some dashed or dotted lines from being skipped when printing
    or in print preview.
    
    Change-Id: I9d0a8ae743241d17d65935f4bf0d122e4313bff8

diff --git a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
index c281d8e..a8d774a 100644
--- a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
@@ -251,7 +251,6 @@ namespace drawinglayer
                     const double fExt = getWidth(rViewInformation);  // Extend a lot: it'll be clipped after
                     const basegfx::B2DPoint aTmpStart(getStart() - (fExt * aVector));
                     const basegfx::B2DPoint aTmpEnd(getEnd() + (fExt * aVector));
-                    xRetval.realloc(1);
 
                     // Get which is the line to show
                     bool bIsSolidline = isSolidLine();
@@ -273,6 +272,7 @@ namespace drawinglayer
                         aPolygon.append( getStart() );
                         aPolygon.append( getEnd() );
 
+                        xRetval.realloc(1);
                         xRetval[0] = Primitive2DReference(new PolygonHairlinePrimitive2D(
                             aPolygon,
                             aColor));
@@ -308,8 +308,28 @@ namespace drawinglayer
                                 aDashed.setB2DPolygon( i, aClipped.getB2DPolygon( 0 ) );
                         }
 
-                        xRetval[0] = Primitive2DReference(new PolyPolygonColorPrimitive2D(
-                                basegfx::B2DPolyPolygon( aDashed ), aColor));
+                        sal_uInt32 n = aDashed.count();
+                        xRetval.realloc(n);
+                        for (sal_uInt32 i = 0; i < n; ++i)
+                        {
+                            basegfx::B2DPolygon aDash = aDashed.getB2DPolygon(i);
+                            if (bIsHairline)
+                            {
+                                // Convert a rectanglar polygon into a line.
+                                basegfx::B2DPolygon aDash2;
+                                basegfx::B2DRange aRange = aDash.getB2DRange();
+                                basegfx::B2DPoint aPt(aRange.getMinX(), aRange.getMinY());
+                                aDash2.append(basegfx::B2DPoint(aRange.getMinX(), aRange.getMinY()));
+                                aDash2.append(basegfx::B2DPoint(aRange.getMaxX(), aRange.getMinY()));
+                                xRetval[i] = Primitive2DReference(
+                                    new PolygonHairlinePrimitive2D(aDash2, aColor));
+                            }
+                            else
+                            {
+                                xRetval[i] = Primitive2DReference(
+                                    new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aDash), aColor));
+                            }
+                        }
                     }
                 }
             }
commit fbbd7ea5eaaee548e8691ced0e4986af1524dd01
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Jan 14 18:39:44 2014 -0500

    Fixed comment.
    
    Change-Id: I48d8ed8e218508f4f2d8f377fa9052ba02e61f37

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index a805bd2..8f9b537 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -293,7 +293,7 @@ namespace drawinglayer
                 }
                 case PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D :
                 {
-                    // directdraw of text simple portion; added test possibility to check text decompose
+                    // directdraw of decorated text portion; added test possibility to check text decompose
                     static bool bForceComplexTextDecomposition(false);
 
                     // Adapt evtl. used special DrawMode


More information about the Libreoffice-commits mailing list