[Libreoffice-commits] .: 8 commits - sc/source
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Sat Mar 19 10:16:47 PDT 2011
sc/source/core/data/attarray.cxx | 5
sc/source/core/data/dpoutput.cxx | 3
sc/source/core/data/scdpoutputimpl.cxx | 9 -
sc/source/filter/excel/xistyle.cxx | 36 +++---
sc/source/filter/html/htmlexp.cxx | 18 +++
sc/source/filter/html/htmlpars.cxx | 11 --
sc/source/filter/lotus/lotattr.cxx | 23 ++--
sc/source/filter/starcalc/scflt.cxx | 24 ++--
sc/source/filter/xml/xmlstyle.cxx | 6 -
sc/source/filter/xml/xmlstyli.cxx | 6 -
sc/source/ui/inc/output.hxx | 3
sc/source/ui/unoobj/cellsuno.cxx | 12 +-
sc/source/ui/view/formatsh.cxx | 8 -
sc/source/ui/view/output.cxx | 171 ++++++++++++++++-----------------
sc/source/ui/view/tabvwsh4.cxx | 2
sc/source/ui/view/tabvwsh8.cxx | 5
sc/source/ui/view/viewfun2.cxx | 8 -
17 files changed, 175 insertions(+), 175 deletions(-)
New commits:
commit 6a0cc7552f0495a034552317fa501521465b8019
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Tue Mar 15 17:10:48 2011 +0100
Fixed the odf import of border in calc: style was missing
diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx
index a2e040f..bf5d8ec 100644
--- a/sc/source/filter/xml/xmlstyle.cxx
+++ b/sc/source/filter/xml/xmlstyle.cxx
@@ -333,7 +333,8 @@ void ScXMLCellExportPropertyMapper::ContextFilter(
aLeft.Color == aBottom.Color && aLeft.InnerLineWidth == aBottom.InnerLineWidth &&
aLeft.OuterLineWidth == aBottom.OuterLineWidth && aLeft.LineDistance == aBottom.LineDistance &&
aLeft.LineStyle == aRight.LineStyle && aLeft.LineStyle == aTop.LineStyle &&
- aLeft.LineStyle == aBottom.LineStyle )
+ aLeft.LineStyle == aBottom.LineStyle && aLeft.LineWidth == aRight.LineWidth &&
+ aLeft.LineWidth == aTop.LineWidth && aLeft.LineWidth == aBottom.LineWidth )
{
pBorder_Left->mnIndex = -1;
pBorder_Left->maValue.clear();
@@ -370,7 +371,8 @@ void ScXMLCellExportPropertyMapper::ContextFilter(
aLeft.LineDistance == aRight.LineDistance && aLeft.InnerLineWidth == aTop.InnerLineWidth &&
aLeft.OuterLineWidth == aTop.OuterLineWidth && aLeft.LineDistance == aTop.LineDistance &&
aLeft.InnerLineWidth == aBottom.InnerLineWidth && aLeft.OuterLineWidth == aBottom.OuterLineWidth &&
- aLeft.LineDistance == aBottom.LineDistance )
+ aLeft.LineDistance == aBottom.LineDistance && aLeft.LineWidth == aRight.LineWidth &&
+ aLeft.LineWidth == aTop.LineWidth && aLeft.LineWidth == aBottom.LineWidth )
{
pLeftBorderWidthState->mnIndex = -1;
pLeftBorderWidthState->maValue.clear();
diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx
index 715e7fc..f4b7d6b 100644
--- a/sc/source/filter/xml/xmlstyli.cxx
+++ b/sc/source/filter/xml/xmlstyli.cxx
@@ -171,14 +171,14 @@ void ScXMLCellImportPropertyMapper::finished(::std::vector< XMLPropertyState >&
{
table::BorderLine2 aBorderLine;
pBorders[i]->maValue >>= aBorderLine;
- if( pBorderWidths[i] )
+ if( pBorderWidths[i] )
{
table::BorderLine2 aBorderLineWidth;
pBorderWidths[i]->maValue >>= aBorderLineWidth;
aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
- aBorderLine.LineStyle = aBorderLineWidth.LineStyle;
+ aBorderLine.LineWidth = aBorderLineWidth.LineWidth;
pBorders[i]->maValue <<= aBorderLine;
}
}
@@ -197,7 +197,7 @@ void ScXMLCellImportPropertyMapper::finished(::std::vector< XMLPropertyState >&
aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
- aBorderLine.LineStyle = aBorderLineWidth.LineStyle;
+ aBorderLine.LineWidth = aBorderLineWidth.LineWidth;
pDiagBorders[i]->maValue <<= aBorderLine;
if (pDiagBorderWidths[i])
pDiagBorderWidths[i]->mnIndex = -1;
commit 930df665160f65e82f3a8dde4a279dda0748be80
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Tue Mar 15 15:39:08 2011 +0100
Added the new border types to the HTML export
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 136e0b9..b96d403 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -506,14 +506,28 @@ void ScHTMLExport::BorderToStyle( ByteString& rOut, const char* pBorderName,
((rOut += "border-") += pBorderName) += ": ";
// thickness
- int nWidth = pLine->GetOutWidth();
+ int nWidth = pLine->GetWidth();
int nPxWidth = ( nWidth > 0 )? std::max( int( nWidth / TWIPS_PER_PIXEL ), 1 ): 0;
(rOut += ByteString::CreateFromInt32( nPxWidth )) += "px ";
switch ( pLine->GetStyle() )
{
+ case SOLID: rOut += "solid"; break;
case DOTTED: rOut += "dotted"; break;
case DASHED: rOut += "dashed"; break;
- default: rOut += "solid";
+ case DOUBLE:
+ case THINTHICK_SMALLGAP:
+ case THINTHICK_MEDIUMGAP:
+ case THINTHICK_LARGEGAP:
+ case THICKTHIN_SMALLGAP:
+ case THICKTHIN_MEDIUMGAP:
+ case THICKTHIN_LARGEGAP:
+ rOut += "double";
+ break;
+ case EMBOSSED: rOut += "ridge"; break;
+ case ENGRAVED: rOut += "groove"; break;
+ case OUTSET: rOut += "outset"; break;
+ case INSET: rOut += "inset"; break;
+ default: rOut += "hidden";
}
rOut += " #";
commit 51f6846aa349600b30f0e9f2738cfdbbac1865f0
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Mon Mar 14 16:07:50 2011 +0100
sc: don't draw the slanted border twice at all tp remove visual side effects
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 86bd0c6..efdd182 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -1577,22 +1577,20 @@ void ScOutputData::DrawRotatedFrame( const Color* pForceColor )
{
pPattern = rInfo.pPatternAttr;
pCondSet = rInfo.pConditionSet;
- SvxRotateMode eRotMode = (SvxRotateMode)((const SvxRotateModeItem&)
- pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet)).GetValue();
size_t nCol = lclGetArrayColFromCellInfoX( nArrX, nX1, nX2, bLayoutRTL );
// horizontal: angrenzende Linie verlaengern
// (nur, wenn die gedrehte Zelle eine Umrandung hat)
sal_uInt16 nDir = rInfo.nRotateDir;
- if ( rArray.GetCellStyleTop( nCol, nRow ).Prim() && eRotMode != SVX_ROTATE_MODE_TOP )
+ if ( rArray.GetCellStyleTop( nCol, nRow ).Prim() )
{
svx::frame::Style aStyle( lcl_FindHorLine( pDoc, nX, nY, nTab, nDir, sal_True ), nPPTY );
rArray.SetCellStyleTop( nCol, nRow, aStyle );
if( nRow > 0 )
rArray.SetCellStyleBottom( nCol, nRow - 1, aStyle );
}
- if ( rArray.GetCellStyleBottom( nCol, nRow ).Prim() && eRotMode != SVX_ROTATE_MODE_BOTTOM )
+ if ( rArray.GetCellStyleBottom( nCol, nRow ).Prim() )
{
svx::frame::Style aStyle( lcl_FindHorLine( pDoc, nX, nY, nTab, nDir, false ), nPPTY );
rArray.SetCellStyleBottom( nCol, nRow, aStyle );
commit 5fe50c2a1eb5844aefcc309cea4e109d2a46bcad
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Mon Mar 14 15:23:12 2011 +0100
sc: draw slanted borders using the drawinglayer primitives
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index c56b56a..86bd0c6 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -1296,98 +1296,17 @@ const SvxBorderLine* lcl_FindHorLine( ScDocument* pDoc,
return pNextTop;
}
-// lcl_HorizLine muss genau zu normal ausgegebenen Linien passen!
-void lcl_HorizLine( OutputDevice& rDev, const Point& rLeft, const Point& rRight,
- const svx::frame::Style& rLine, const Color* pForceColor )
+long lcl_getRotate( ScDocument* pDoc, SCTAB nTab, SCCOL nX, SCROW nY )
{
- svx::frame::DrawHorFrameBorder( rDev, rLeft, rRight, rLine, pForceColor );
-}
-
-void lcl_VertLineEnds( OutputDevice& rDev, const Point& rTop, const Point& rBottom,
- const Color& rColor, long nXOffs, long nWidth,
- const svx::frame::Style& rTopLine, const svx::frame::Style& rBottomLine )
-{
- rDev.SetLineColor(rColor); // PEN_NULL ???
- rDev.SetFillColor(rColor);
-
- // Position oben/unten muss unabhaengig von der Liniendicke sein,
- // damit der Winkel stimmt (oder X-Position auch anpassen)
- long nTopPos = rTop.Y();
- long nBotPos = rBottom.Y();
-
- long nTopLeft = rTop.X() + nXOffs;
- long nTopRight = nTopLeft + nWidth - 1;
-
- long nBotLeft = rBottom.X() + nXOffs;
- long nBotRight = nBotLeft + nWidth - 1;
-
- // oben abschliessen
-
- if ( rTopLine.Prim() )
- {
- long nLineW = rTopLine.GetWidth();
- if (nLineW >= 2)
- {
- Point aTriangle[3];
- aTriangle[0] = Point( nTopLeft, nTopPos ); // wie aPoints[0]
- aTriangle[1] = Point( nTopRight, nTopPos ); // wie aPoints[1]
- aTriangle[2] = Point( rTop.X(), nTopPos - (nLineW - 1) / 2 );
- Polygon aTriPoly( 3, aTriangle );
- rDev.DrawPolygon( aTriPoly );
- }
- }
-
- // unten abschliessen
-
- if ( rBottomLine.Prim() )
- {
- long nLineW = rBottomLine.GetWidth();
- if (nLineW >= 2)
- {
- Point aTriangle[3];
- aTriangle[0] = Point( nBotLeft, nBotPos ); // wie aPoints[3]
- aTriangle[1] = Point( nBotRight, nBotPos ); // wie aPoints[2]
- aTriangle[2] = Point( rBottom.X(), nBotPos - (nLineW - 1) / 2 + nLineW - 1 );
- Polygon aTriPoly( 3, aTriangle );
- rDev.DrawPolygon( aTriPoly );
- }
- }
-}
-
-void lcl_VertLine( OutputDevice& rDev, const Point& rTop, const Point& rBottom,
- const svx::frame::Style& rLine,
- const svx::frame::Style& rTopLine, const svx::frame::Style& rBottomLine,
- const Color* pForceColor )
-{
- if( rLine.Prim() )
- {
- svx::frame::DrawVerFrameBorderSlanted( rDev, rTop, rBottom, rLine, pForceColor );
-
- svx::frame::Style aScaled( rLine );
- aScaled.ScaleSelf( 1.0 / cos( svx::frame::GetVerDiagAngle( rTop, rBottom ) ) );
- if( pForceColor )
- {
- aScaled.SetColorPrim( *pForceColor );
- aScaled.SetColorSecn( *pForceColor );
- }
+ long nRotate = 0;
- long nXOffs = (aScaled.GetWidth() - 1) / -2L;
+ const ScPatternAttr* pPattern = pDoc->GetPattern( nX, nY, nTab );
+ const SfxItemSet* pCondSet = pDoc->GetCondResult( nX, nY, nTab );
- lcl_VertLineEnds( rDev, rTop, rBottom, aScaled.GetColorPrim(),
- nXOffs, aScaled.Prim(), rTopLine, rBottomLine );
+ nRotate = pPattern->GetRotateVal( pCondSet );
- if( aScaled.Secn() )
- {
- if ( aScaled.UseGapColor() )
- {
- lcl_VertLineEnds( rDev, rTop, rBottom, aScaled.GetColorGap(),
- nXOffs + aScaled.Prim(), aScaled.Dist(), rTopLine, rBottomLine );
- }
- lcl_VertLineEnds( rDev, rTop, rBottom, aScaled.GetColorSecn(),
- nXOffs + aScaled.Prim() + aScaled.Dist(), aScaled.Secn(), rTopLine, rBottomLine );
- }
- }
+ return nRotate;
}
void ScOutputData::DrawRotatedFrame( const Color* pForceColor )
@@ -1426,6 +1345,7 @@ void ScOutputData::DrawRotatedFrame( const Color* pForceColor )
pDev->SetClipRegion( Region( aClipRect ) );
svx::frame::Array& rArray = mrTabInfo.maArray;
+ drawinglayer::processor2d::BaseProcessor2D* pProcessor = CreateProcessor2D( );
long nPosY = nScrY;
for (SCSIZE nArrY=1; nArrY<nArrCount; nArrY++)
@@ -1594,13 +1514,52 @@ void ScOutputData::DrawRotatedFrame( const Color* pForceColor )
std::swap( aLeftLine, aRightLine );
}
- drawinglayer::processor2d::BaseProcessor2D* pProcessor = CreateProcessor2D( );
- pProcessor->process( svx::frame::CreateBorderPrimitives( aPoints[bLayoutRTL?1:0], aPoints[bLayoutRTL?0:1], aTopLine, pForceColor ) );
- pProcessor->process( svx::frame::CreateBorderPrimitives( aPoints[bLayoutRTL?2:3], aPoints[bLayoutRTL?3:2], aBottomLine, pForceColor ) );
-
- lcl_VertLine( *pDev, aPoints[0], aPoints[3], aLeftLine, aTopLine, aBottomLine, pForceColor );
- lcl_VertLine( *pDev, aPoints[1], aPoints[2], aRightLine, aTopLine, aBottomLine, pForceColor );
- if ( pProcessor ) delete pProcessor;
+ const svx::frame::Style noStyle;
+ // Horizontal lines
+ long nUpperRotate = lcl_getRotate( pDoc, nTab, nX, nY - 1 );
+ pProcessor->process( svx::frame::CreateBorderPrimitives(
+ aPoints[bLayoutRTL?1:0], aPoints[bLayoutRTL?0:1], aTopLine,
+ svx::frame::Style(),
+ svx::frame::Style(),
+ aLeftLine,
+ svx::frame::Style(),
+ svx::frame::Style(),
+ aRightLine,
+ pForceColor, nUpperRotate, nAttrRotate ) );
+
+ long nLowerRotate = lcl_getRotate( pDoc, nTab, nX, nY + 1 );
+ pProcessor->process( svx::frame::CreateBorderPrimitives(
+ aPoints[bLayoutRTL?2:3], aPoints[bLayoutRTL?3:2], aBottomLine,
+ aLeftLine,
+ svx::frame::Style(),
+ svx::frame::Style(),
+ aRightLine,
+ svx::frame::Style(),
+ svx::frame::Style(),
+ pForceColor, 18000 - nAttrRotate, 18000 - nLowerRotate ) );
+
+ // Vertical slanted lines
+ long nLeftRotate = lcl_getRotate( pDoc, nTab, nX - 1, nY );
+ pProcessor->process( svx::frame::CreateBorderPrimitives(
+ aPoints[0], aPoints[3], aLeftLine,
+ aTopLine,
+ svx::frame::Style(),
+ svx::frame::Style(),
+ aBottomLine,
+ svx::frame::Style(),
+ svx::frame::Style(),
+ pForceColor, nAttrRotate, nLeftRotate ) );
+
+ long nRightRotate = lcl_getRotate( pDoc, nTab, nX + 1, nY );
+ pProcessor->process( svx::frame::CreateBorderPrimitives(
+ aPoints[1], aPoints[2], aRightLine,
+ svx::frame::Style(),
+ svx::frame::Style(),
+ aTopLine,
+ svx::frame::Style(),
+ svx::frame::Style(),
+ aBottomLine,
+ pForceColor, 18000 - nRightRotate, 18000 - nAttrRotate ) );
}
}
nPosX += nColWidth * nLayoutSign;
@@ -1664,6 +1623,8 @@ void ScOutputData::DrawRotatedFrame( const Color* pForceColor )
nPosY += nRowHeight;
}
+ if ( pProcessor ) delete pProcessor;
+
if (bMetaFile)
pDev->Pop();
else
commit 3c88ad97e47bb3b5b72df2776fa3361510adba8e
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Tue Feb 22 18:14:32 2011 +0100
Using drawinglayer for the rotated cells horizontal borders
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 9e0d2d6..c56b56a 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -1594,11 +1594,13 @@ void ScOutputData::DrawRotatedFrame( const Color* pForceColor )
std::swap( aLeftLine, aRightLine );
}
- lcl_HorizLine( *pDev, aPoints[bLayoutRTL?1:0], aPoints[bLayoutRTL?0:1], aTopLine, pForceColor );
- lcl_HorizLine( *pDev, aPoints[bLayoutRTL?2:3], aPoints[bLayoutRTL?3:2], aBottomLine, pForceColor );
+ drawinglayer::processor2d::BaseProcessor2D* pProcessor = CreateProcessor2D( );
+ pProcessor->process( svx::frame::CreateBorderPrimitives( aPoints[bLayoutRTL?1:0], aPoints[bLayoutRTL?0:1], aTopLine, pForceColor ) );
+ pProcessor->process( svx::frame::CreateBorderPrimitives( aPoints[bLayoutRTL?2:3], aPoints[bLayoutRTL?3:2], aBottomLine, pForceColor ) );
lcl_VertLine( *pDev, aPoints[0], aPoints[3], aLeftLine, aTopLine, aBottomLine, pForceColor );
lcl_VertLine( *pDev, aPoints[1], aPoints[2], aRightLine, aTopLine, aBottomLine, pForceColor );
+ if ( pProcessor ) delete pProcessor;
}
}
nPosX += nColWidth * nLayoutSign;
commit bf9aaaec78793e1572df1812308c7aae2cb9f4b3
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Tue Feb 22 15:26:34 2011 +0100
Use svx::frame::DrawRange with the drawinglayer in calc now
diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx
index 87173dc..2930d51 100644
--- a/sc/source/ui/inc/output.hxx
+++ b/sc/source/ui/inc/output.hxx
@@ -33,6 +33,7 @@
#include <tools/color.hxx>
#include <tools/fract.hxx>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
class Rectangle;
class Font;
@@ -182,6 +183,8 @@ private:
void DrawRotatedFrame( const Color* pForceColor ); // pixel
+ drawinglayer::processor2d::BaseProcessor2D* CreateProcessor2D( );
+
public:
ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType,
ScTableInfo& rTabInfo, ScDocument* pNewDoc,
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index d8b362c..9e0d2d6 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -47,9 +47,15 @@
#include <vcl/pdfextoutdevdata.hxx>
#include <svtools/accessibilityoptions.hxx>
#include <svx/framelinkarray.hxx>
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svx/sdr/contact/objectcontacttools.hxx>
+#include <svx/unoapi.hxx>
#include "output.hxx"
#include "document.hxx"
+#include "drwlayer.hxx"
#include "cell.hxx"
#include "attrib.hxx"
#include "patattr.hxx"
@@ -1215,6 +1221,7 @@ void ScOutputData::DrawFrame()
// draw only rows with set RowInfo::bChanged flag
size_t nRow1 = nFirstRow;
+ drawinglayer::processor2d::BaseProcessor2D* pProcessor = CreateProcessor2D();
while( nRow1 <= nLastRow )
{
while( (nRow1 <= nLastRow) && !pRowInfo[ nRow1 ].bChanged ) ++nRow1;
@@ -1222,10 +1229,12 @@ void ScOutputData::DrawFrame()
{
size_t nRow2 = nRow1;
while( (nRow2 + 1 <= nLastRow) && pRowInfo[ nRow2 + 1 ].bChanged ) ++nRow2;
- rArray.DrawRange( *pDev, nFirstCol, nRow1, nLastCol, nRow2, pForceColor );
+ rArray.DrawRange( pProcessor, nFirstCol, nRow1, nLastCol, nRow2, pForceColor );
nRow1 = nRow2 + 1;
}
}
+ if ( pProcessor )
+ delete pProcessor;
pDev->SetDrawMode(nOldDrawMode);
}
@@ -1659,6 +1668,23 @@ void ScOutputData::DrawRotatedFrame( const Color* pForceColor )
pDev->SetClipRegion();
}
+drawinglayer::processor2d::BaseProcessor2D* ScOutputData::CreateProcessor2D( )
+{
+ basegfx::B2DRange aViewRange;
+
+ SdrPage *pDrawPage = pDoc->GetDrawLayer()->GetPage( static_cast< sal_uInt16 >( nTab ) );
+ const drawinglayer::geometry::ViewInformation2D aNewViewInfos(
+ basegfx::B2DHomMatrix( ),
+ pDev->GetViewTransformation(),
+ aViewRange,
+ GetXDrawPageForSdrPage( pDrawPage ),
+ 0.0,
+ uno::Sequence< beans::PropertyValue >() );
+
+ return sdr::contact::createBaseProcessor2DFromOutputDevice(
+ *pDev, aNewViewInfos );
+}
+
// Drucker
PolyPolygon ScOutputData::GetChangedArea()
commit fb973aaf5231341d300dc160a3eea7b27a3f4fae
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Fri Dec 24 10:00:15 2010 +0100
Switching the order of the SetLinesWidth arguments
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 9ea721c..1ec370a 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -586,9 +586,8 @@ void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet*
if ((dest)) \
{ \
SvxBorderLine* pCast = (SvxBorderLine*)(dest); \
- pCast->SetOutWidth((src)->GetOutWidth()); \
- pCast->SetInWidth( (src)->GetInWidth() ); \
- pCast->SetDistance((src)->GetDistance()); \
+ pCast->SetStyle( (src)->GetStyle( ) ); \
+ pCast->SetWidth( (src)->GetWidth( ) ); \
}
void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index ab16771..682237a 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -157,8 +157,7 @@ void lcl_SetFrame( ScDocument* pDoc, SCTAB nTab,
SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
sal_uInt16 nWidth )
{
- SvxBorderLine aLine;
- aLine.SetOutWidth(nWidth);
+ SvxBorderLine aLine( NULL, nWidth, SOLID );
SvxBoxItem aBox( ATTR_BORDER );
aBox.SetLine(&aLine, BOX_LINE_LEFT);
aBox.SetLine(&aLine, BOX_LINE_TOP);
diff --git a/sc/source/core/data/scdpoutputimpl.cxx b/sc/source/core/data/scdpoutputimpl.cxx
index f1a0882..f66f16c 100644
--- a/sc/source/core/data/scdpoutputimpl.cxx
+++ b/sc/source/core/data/scdpoutputimpl.cxx
@@ -138,12 +138,9 @@ sal_Bool OutputImpl::AddCol( SCCOL nCol )
void OutputImpl::OutputBlockFrame ( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sal_Bool bHori )
{
-
- SvxBorderLine aLine, aOutLine;
- aLine.SetColor( SC_DP_FRAME_COLOR );
- aLine.SetOutWidth( SC_DP_FRAME_INNER_BOLD );
- aOutLine.SetColor( SC_DP_FRAME_COLOR );
- aOutLine.SetOutWidth( SC_DP_FRAME_OUTER_BOLD );
+ Color color = SC_DP_FRAME_COLOR;
+ SvxBorderLine aLine( &color, SC_DP_FRAME_INNER_BOLD );
+ SvxBorderLine aOutLine( &color, SC_DP_FRAME_OUTER_BOLD );
SvxBoxItem aBox( ATTR_BORDER );
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 290ce0e..bac3fe6 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -913,21 +913,21 @@ bool lclConvertBorderLine( SvxBorderLine& rLine, const XclImpPalette& rPalette,
{
static const sal_uInt16 ppnLineParam[][ 4 ] =
{
- // outer width, inner width, distance type
- { 0, 0, 0, SOLID }, // 0 = none
- { XLS_LINE_WIDTH_THIN, 0, 0, SOLID }, // 1 = thin
- { XLS_LINE_WIDTH_MEDIUM, 0, 0, SOLID }, // 2 = medium
- { XLS_LINE_WIDTH_THIN, 0, 0, DASHED }, // 3 = dashed
- { XLS_LINE_WIDTH_THIN, 0, 0, DOTTED }, // 4 = dotted
- { XLS_LINE_WIDTH_THICK, 0, 0, SOLID }, // 5 = thick
- { XLS_LINE_WIDTH_THIN, XLS_LINE_WIDTH_THIN, XLS_LINE_WIDTH_THIN, SOLID }, // 6 = double
- { XLS_LINE_WIDTH_HAIR, 0, 0, SOLID }, // 7 = hair
- { XLS_LINE_WIDTH_MEDIUM, 0, 0, DASHED }, // 8 = med dash
- { XLS_LINE_WIDTH_THIN, 0, 0, SOLID }, // 9 = thin dashdot
- { XLS_LINE_WIDTH_MEDIUM, 0, 0, SOLID }, // A = med dashdot
- { XLS_LINE_WIDTH_THIN, 0, 0, SOLID }, // B = thin dashdotdot
- { XLS_LINE_WIDTH_MEDIUM, 0, 0, SOLID }, // C = med dashdotdot
- { XLS_LINE_WIDTH_MEDIUM, 0, 0, SOLID } // D = med slant dashdot
+ // outer width, type
+ { 0, SOLID }, // 0 = none
+ { XLS_LINE_WIDTH_THIN, SOLID }, // 1 = thin
+ { XLS_LINE_WIDTH_MEDIUM, SOLID }, // 2 = medium
+ { XLS_LINE_WIDTH_THIN, DASHED }, // 3 = dashed
+ { XLS_LINE_WIDTH_THIN, DOTTED }, // 4 = dotted
+ { XLS_LINE_WIDTH_THICK, SOLID }, // 5 = thick
+ { XLS_LINE_WIDTH_THIN, DOUBLE }, // 6 = double
+ { XLS_LINE_WIDTH_HAIR, SOLID }, // 7 = hair
+ { XLS_LINE_WIDTH_MEDIUM, DASHED }, // 8 = med dash
+ { XLS_LINE_WIDTH_THIN, SOLID }, // 9 = thin dashdot
+ { XLS_LINE_WIDTH_MEDIUM, SOLID }, // A = med dashdot
+ { XLS_LINE_WIDTH_THIN, SOLID }, // B = thin dashdotdot
+ { XLS_LINE_WIDTH_MEDIUM, SOLID }, // C = med dashdotdot
+ { XLS_LINE_WIDTH_MEDIUM, SOLID } // D = med slant dashdot
};
if( nXclLine == EXC_LINE_NONE )
@@ -936,10 +936,8 @@ bool lclConvertBorderLine( SvxBorderLine& rLine, const XclImpPalette& rPalette,
nXclLine = EXC_LINE_THIN;
rLine.SetColor( rPalette.GetColor( nXclColor ) );
- rLine.SetOutWidth( ppnLineParam[ nXclLine ][ 0 ] );
- rLine.SetInWidth( ppnLineParam[ nXclLine ][ 1 ] );
- rLine.SetDistance( ppnLineParam[ nXclLine ][ 2 ] );
- rLine.SetStyle( (SvxBorderStyle)ppnLineParam[ nXclLine ][ 3 ] );
+ rLine.SetWidth( ppnLineParam[ nXclLine ][ 0 ] );
+ rLine.SetStyle( (SvxBorderStyle)ppnLineParam[ nXclLine ][ 1 ] );
return true;
}
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index c1f6cac..05d7139 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -2190,13 +2190,10 @@ void ScHTMLTable::ApplyCellBorders( ScDocument* pDoc, const ScAddress& rFirstPos
{
const SCCOL nLastCol = maSize.mnCols - 1;
const SCROW nLastRow = maSize.mnRows - 1;
- const sal_uInt16 nOuterLine = DEF_LINE_WIDTH_2;
- const sal_uInt16 nInnerLine = DEF_LINE_WIDTH_0;
- SvxBorderLine aOuterLine, aInnerLine;
- aOuterLine.SetColor( Color( COL_BLACK ) );
- aOuterLine.SetOutWidth( nOuterLine );
- aInnerLine.SetColor( Color( COL_BLACK ) );
- aInnerLine.SetOutWidth( nInnerLine );
+ const long nOuterLine = DEF_LINE_WIDTH_2;
+ const long nInnerLine = DEF_LINE_WIDTH_0;
+ SvxBorderLine aOuterLine( NULL, nOuterLine, SOLID );
+ SvxBorderLine aInnerLine( NULL, nInnerLine, SOLID );
SvxBoxItem aBorderItem( ATTR_BORDER );
for( SCCOL nCol = 0; nCol <= nLastCol; ++nCol )
diff --git a/sc/source/filter/lotus/lotattr.cxx b/sc/source/filter/lotus/lotattr.cxx
index dd4f8a0..ce71a8f 100644
--- a/sc/source/filter/lotus/lotattr.cxx
+++ b/sc/source/filter/lotus/lotattr.cxx
@@ -170,21 +170,20 @@ const ScPatternAttr& LotAttrCache::GetPattAttr( const LotAttrWK3& rAttr )
void LotAttrCache::LotusToScBorderLine( sal_uInt8 nLine, SvxBorderLine& aBL )
{
- static const sal_uInt16 pPara[ 4 ][ 3 ] =
- {
- { 0,0,0 },
- { DEF_LINE_WIDTH_1, 0, 0 },
- { DEF_LINE_WIDTH_2, 0, 0 },
- { DEF_LINE_WIDTH_1, DEF_LINE_WIDTH_1, DEF_LINE_WIDTH_1 }
- };
-
nLine &= 0x03;
- if( nLine )
+ switch ( nLine )
{
- aBL.SetOutWidth( pPara[ nLine ][ 0 ] );
- aBL.SetInWidth( pPara[ nLine ][ 1 ] );
- aBL.SetDistance( pPara[ nLine ][ 2 ] );
+ default:
+ case 0: aBL.SetStyle( NO_STYLE ); break;
+ case 1: aBL.SetWidth( DEF_LINE_WIDTH_1 ); break;
+ case 2: aBL.SetWidth( DEF_LINE_WIDTH_2 ); break;
+ case 3:
+ {
+ aBL.SetStyle( DOUBLE );
+ aBL.SetWidth( DEF_LINE_WIDTH_1 );
+ }
+ break;
}
}
diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx
index c36ed5e..4f76ae8 100644
--- a/sc/source/filter/starcalc/scflt.cxx
+++ b/sc/source/filter/starcalc/scflt.cxx
@@ -834,16 +834,16 @@ void Sc10PageCollection::PutToDoc( ScDocument* pDoc )
lcl_ChangeColor(cBottom, ColorBottom);
SvxBorderLine aLine;
SvxBoxItem aBox( ATTR_BORDER );
- aLine.SetOutWidth(nLeft);
+ aLine.SetWidth(nLeft);
aLine.SetColor(ColorLeft);
aBox.SetLine(&aLine, BOX_LINE_LEFT);
- aLine.SetOutWidth(nTop);
+ aLine.SetWidth(nTop);
aLine.SetColor(ColorTop);
aBox.SetLine(&aLine, BOX_LINE_TOP);
- aLine.SetOutWidth(nRight);
+ aLine.SetWidth(nRight);
aLine.SetColor(ColorRight);
aBox.SetLine(&aLine, BOX_LINE_RIGHT);
- aLine.SetOutWidth(nBottom);
+ aLine.SetWidth(nBottom);
aLine.SetColor(ColorBottom);
aBox.SetLine(&aLine, BOX_LINE_BOTTOM);
@@ -1271,16 +1271,16 @@ void Sc10Import::LoadPatternCollection()
SvxBorderLine aLine;
SvxBoxItem aBox( ATTR_BORDER );
- aLine.SetOutWidth( nLeft );
+ aLine.SetWidth( nLeft );
aLine.SetColor( ColorLeft );
aBox.SetLine( &aLine, BOX_LINE_LEFT );
- aLine.SetOutWidth( nTop );
+ aLine.SetWidth( nTop );
aLine.SetColor( ColorTop );
aBox.SetLine( &aLine, BOX_LINE_TOP );
- aLine.SetOutWidth( nRight );
+ aLine.SetWidth( nRight );
aLine.SetColor( ColorRight );
aBox.SetLine( &aLine, BOX_LINE_RIGHT );
- aLine.SetOutWidth( nBottom );
+ aLine.SetWidth( nBottom );
aLine.SetColor( ColorBottom );
aBox.SetLine( &aLine, BOX_LINE_BOTTOM );
rItemSet.Put( aBox );
@@ -1924,19 +1924,19 @@ void Sc10Import::LoadColAttr(SCCOL Col, SCTAB Tab)
SvxBorderLine aLine;
SvxBoxItem aBox( ATTR_BORDER );
- aLine.SetOutWidth( nLeft );
+ aLine.SetWidth( nLeft );
aLine.SetColor( ColorLeft );
aBox.SetLine( &aLine, BOX_LINE_LEFT );
- aLine.SetOutWidth( nTop );
+ aLine.SetWidth( nTop );
aLine.SetColor( ColorTop );
aBox.SetLine( &aLine, BOX_LINE_TOP );
- aLine.SetOutWidth( nRight );
+ aLine.SetWidth( nRight );
aLine.SetColor( ColorRight );
aBox.SetLine( &aLine, BOX_LINE_RIGHT );
- aLine.SetOutWidth( nBottom );
+ aLine.SetWidth( nBottom );
aLine.SetColor( ColorBottom );
aBox.SetLine( &aLine, BOX_LINE_BOTTOM );
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 9360223..0787e47 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -951,11 +951,13 @@ ScSubTotalFunc lcl_SummaryToSubTotal( sheet::GeneralFunction eSummary )
const SvxBorderLine* ScHelperFunctions::GetBorderLine( SvxBorderLine& rLine, const table::BorderLine& rStruct )
{
- // Calc braucht Twips, im Uno-Struct sind 1/100mm
-
- rLine.SetOutWidth( (sal_uInt16)HMMToTwips( rStruct.OuterLineWidth ) );
- rLine.SetInWidth( (sal_uInt16)HMMToTwips( rStruct.InnerLineWidth ) );
- rLine.SetDistance( (sal_uInt16)HMMToTwips( rStruct.LineDistance ) );
+ // Calc needs Twips, and there are 1/100mm in the Uno structure
+ const table::BorderLine2& rBorder2 = static_cast< const table::BorderLine2& >( rStruct );
+ rLine.SetStyle( SvxBorderStyle( rBorder2.LineStyle ) );
+ rLine.GuessLinesWidths( rLine.GetStyle(),
+ (sal_uInt16)HMMToTwips( rStruct.OuterLineWidth ),
+ (sal_uInt16)HMMToTwips( rStruct.InnerLineWidth ),
+ (sal_uInt16)HMMToTwips( rStruct.LineDistance ) );
rLine.SetColor( ColorData( rStruct.Color ) );
if ( rLine.GetOutWidth() || rLine.GetInWidth() || rLine.GetDistance() )
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 213caea..b44f09d 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1511,10 +1511,8 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
if ( pDefLine )
{
- pDefLine->SetOutWidth( pLine->GetOutWidth() );
- pDefLine->SetInWidth ( pLine->GetInWidth() );
- pDefLine->SetDistance( pLine->GetDistance() );
pDefLine->SetStyle( pLine->GetStyle( ) );
+ pDefLine->SetWidth( pLine->GetWidth( ) );
pTabViewShell->SetSelectionFrameLines( pDefLine, false );
}
else
@@ -1527,7 +1525,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
else
{
Color aColorBlack( COL_BLACK );
- SvxBorderLine aDefLine( &aColorBlack, 20, 0, 0 );
+ SvxBorderLine aDefLine( &aColorBlack, 20, SOLID );
pTabViewShell->SetDefaultFrameLine( &aDefLine );
pTabViewShell->SetSelectionFrameLines( NULL, false );
}
@@ -1549,7 +1547,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
}
else
{
- SvxBorderLine aDefLine( &rColor, 20, 0, 0 );
+ SvxBorderLine aDefLine( &rColor, 20, SOLID );
pTabViewShell->SetDefaultFrameLine( &aDefLine );
pTabViewShell->SetSelectionFrameLines( &aDefLine, false );
}
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 6e02b99..fb47e42 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1505,7 +1505,7 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
SetPool( &SC_MOD()->GetPool() );
SetWindow( GetActiveWin() );
- pCurFrameLine = new SvxBorderLine( &aColBlack, 20, 0, 0 );
+ pCurFrameLine = new SvxBorderLine( &aColBlack, 20, SOLID );
pPivotSource = new ScArea;
StartListening(*GetViewData()->GetDocShell(),sal_True);
StartListening(*GetViewFrame(),sal_True);
diff --git a/sc/source/ui/view/tabvwsh8.cxx b/sc/source/ui/view/tabvwsh8.cxx
index 43885de..7a2f7a4 100644
--- a/sc/source/ui/view/tabvwsh8.cxx
+++ b/sc/source/ui/view/tabvwsh8.cxx
@@ -48,9 +48,8 @@ void ScTabViewShell::SetDefaultFrameLine( const SvxBorderLine* pLine )
{
delete pCurFrameLine;
pCurFrameLine = new SvxBorderLine( &pLine->GetColor(),
- pLine->GetOutWidth(),
- pLine->GetInWidth(),
- pLine->GetDistance() );
+ pLine->GetWidth(),
+ pLine->GetStyle() );
}
else if ( pCurFrameLine )
{
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 517e0b6..70b6ff7 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -2920,18 +2920,14 @@ void ScViewFunc::UpdateLineAttrs( SvxBorderLine& rLine,
if ( bColor )
{
rLine.SetColor ( pSrcLine->GetColor() );
- rLine.SetOutWidth ( pDestLine->GetOutWidth() );
- rLine.SetInWidth ( pDestLine->GetInWidth() );
- rLine.SetDistance ( pDestLine->GetDistance() );
rLine.SetStyle ( pDestLine->GetStyle() );
+ rLine.SetWidth ( pDestLine->GetWidth() );
}
else
{
rLine.SetColor ( pDestLine->GetColor() );
- rLine.SetOutWidth ( pSrcLine->GetOutWidth() );
- rLine.SetInWidth ( pSrcLine->GetInWidth() );
- rLine.SetDistance ( pSrcLine->GetDistance() );
rLine.SetStyle ( pSrcLine->GetStyle() );
+ rLine.SetWidth ( pSrcLine->GetWidth() );
}
}
}
commit c14c1846e26287bfd2ad586962f75c1e9bbb1103
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Sat Nov 6 19:06:40 2010 +0100
Draw nice borders using drawinglayer
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 3190eb3..d8b362c 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -1358,16 +1358,26 @@ void lcl_VertLine( OutputDevice& rDev, const Point& rTop, const Point& rBottom,
svx::frame::Style aScaled( rLine );
aScaled.ScaleSelf( 1.0 / cos( svx::frame::GetVerDiagAngle( rTop, rBottom ) ) );
if( pForceColor )
- aScaled.SetColor( *pForceColor );
+ {
+ aScaled.SetColorPrim( *pForceColor );
+ aScaled.SetColorSecn( *pForceColor );
+ }
long nXOffs = (aScaled.GetWidth() - 1) / -2L;
- lcl_VertLineEnds( rDev, rTop, rBottom, aScaled.GetColor(),
+ lcl_VertLineEnds( rDev, rTop, rBottom, aScaled.GetColorPrim(),
nXOffs, aScaled.Prim(), rTopLine, rBottomLine );
if( aScaled.Secn() )
- lcl_VertLineEnds( rDev, rTop, rBottom, aScaled.GetColor(),
+ {
+ if ( aScaled.UseGapColor() )
+ {
+ lcl_VertLineEnds( rDev, rTop, rBottom, aScaled.GetColorGap(),
+ nXOffs + aScaled.Prim(), aScaled.Dist(), rTopLine, rBottomLine );
+ }
+ lcl_VertLineEnds( rDev, rTop, rBottom, aScaled.GetColorSecn(),
nXOffs + aScaled.Prim() + aScaled.Dist(), aScaled.Secn(), rTopLine, rBottomLine );
+ }
}
}
More information about the Libreoffice-commits
mailing list