[ooo-build-commit] Branch 'ooo-build-3-1-1' - patches/dev300
Kohei Yoshida
kohei at kemper.freedesktop.org
Thu Nov 12 18:44:57 PST 2009
patches/dev300/apply | 3
patches/dev300/calc-xls-import-slanted-border-oox.diff | 93 +++++++++++++++++
patches/dev300/calc-xls-import-slanted-border-sc.diff | 77 ++++++++++++++
patches/dev300/calc-xls-import-slanted-border.diff | 77 --------------
4 files changed, 172 insertions(+), 78 deletions(-)
New commits:
commit 0f971603409080e5136207f56f83db681b2ee70a
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Thu Nov 12 21:41:39 2009 -0500
Set rotate reference to bottom in presence of rotated text and border.
This fixes i#38709 and n#549728. dr already fixed this for 3.3 in the
upstream build.
* patches/dev300/apply:
* patches/dev300/calc-xls-import-slanted-border-oox.diff: for xlsx
import.
* patches/dev300/calc-xls-import-slanted-border.diff:
* patches/dev300/calc-xls-import-slanted-border-sc.diff: renamed.
diff --git a/patches/dev300/apply b/patches/dev300/apply
index bff920a..063aec6 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3465,7 +3465,8 @@ calc-general-type-auto-decimal-officecfg.diff, n#541973, kohei
calc-xls-export-encryption-condfmt-fix.diff, n#541058, kohei
# Set reference edge to bottom when importing cells with slanted text.
-calc-xls-import-slanted-border.diff, n#549728, i#38709, kohei
+calc-xls-import-slanted-border-sc.diff, n#549728, i#38709, kohei
+calc-xls-import-slanted-border-oox.diff, n#549728, i#38709, kohei
[ AutoLayout ]
sd-layoutcode.diff, cocofan
diff --git a/patches/dev300/calc-xls-import-slanted-border-oox.diff b/patches/dev300/calc-xls-import-slanted-border-oox.diff
new file mode 100644
index 0000000..6f22eeb
--- /dev/null
+++ b/patches/dev300/calc-xls-import-slanted-border-oox.diff
@@ -0,0 +1,93 @@
+diff --git oox/inc/oox/xls/stylesbuffer.hxx oox/inc/oox/xls/stylesbuffer.hxx
+index e9d17db..4f288f5 100644
+--- oox/inc/oox/xls/stylesbuffer.hxx
++++ oox/inc/oox/xls/stylesbuffer.hxx
+@@ -434,6 +434,8 @@ public:
+ /** Writes all border attributes to the passed property set. */
+ void writeToPropertySet( PropertySet& rPropSet ) const;
+
++ bool hasBorder() const;
++
+ private:
+ /** Returns the border line struct specified by the passed XML token identifier. */
+ OoxBorderLineData* getBorderLine( sal_Int32 nElement );
+@@ -857,6 +859,7 @@ public:
+ /** Writes the cell formatting attributes of the specified style XF to the passed property set. */
+ void writeStyleXfToPropertySet( PropertySet& rPropSet, sal_Int32 nXfId ) const;
+
++ bool hasBorder( sal_Int32 nBorderId ) const;
+ private:
+ void insertCellStyle( CellStyleRef xCellStyle );
+
+diff --git oox/source/xls/stylesbuffer.cxx oox/source/xls/stylesbuffer.cxx
+index 5627c78..00411bb 100644
+--- oox/source/xls/stylesbuffer.cxx
++++ oox/source/xls/stylesbuffer.cxx
+@@ -40,6 +40,7 @@
+ #include <com/sun/star/style/XStyle.hpp>
+ #include <com/sun/star/text/WritingMode2.hpp>
+ #include <com/sun/star/text/XText.hpp>
++#include <com/sun/star/table/CellVertJustify.hpp>
+ #include <rtl/tencinfo.h>
+ #include <rtl/ustrbuf.hxx>
+ #include "oox/helper/attributelist.hxx"
+@@ -1599,6 +1600,34 @@ void Border::writeToPropertySet( PropertySet& rPropSet ) const
+ getStylesPropertyHelper().writeBorderProperties( rPropSet, maApiData );
+ }
+
++namespace {
++
++bool lcl_isBorder(const ::com::sun::star::table::BorderLine& rBorder)
++{
++ return (rBorder.InnerLineWidth > 0) || (rBorder.OuterLineWidth > 0);
++}
++
++}
++
++bool Border::hasBorder() const
++{
++ const ApiBorderData::ApiTableBorder& rTabBorder = maApiData.maBorder;
++
++ if (rTabBorder.IsBottomLineValid && lcl_isBorder(rTabBorder.BottomLine))
++ return true;
++
++ if (rTabBorder.IsTopLineValid && lcl_isBorder(rTabBorder.TopLine))
++ return true;
++
++ if (rTabBorder.IsLeftLineValid && lcl_isBorder(rTabBorder.LeftLine))
++ return true;
++
++ if (rTabBorder.IsRightLineValid && lcl_isBorder(rTabBorder.RightLine))
++ return true;
++
++ return false;
++}
++
+ OoxBorderLineData* Border::getBorderLine( sal_Int32 nElement )
+ {
+ switch( nElement )
+@@ -2255,6 +2284,11 @@ void Xf::writeToPropertySet( PropertySet& rPropSet ) const
+ rStyles.writeBorderToPropertySet( rPropSet, maOoxData.mnBorderId );
+ if( maOoxData.mbAreaUsed )
+ rStyles.writeFillToPropertySet( rPropSet, maOoxData.mnFillId );
++
++ ::com::sun::star::table::CellVertJustify eRotRef = ::com::sun::star::table::CellVertJustify_STANDARD;
++ if (maOoxData.mbBorderUsed && rStyles.hasBorder(maOoxData.mnBorderId) && maAlignment.getApiData().mnRotation)
++ eRotRef = ::com::sun::star::table::CellVertJustify_BOTTOM;
++ rPropSet.setProperty( CREATE_OUSTRING("RotateReference"), eRotRef );
+ }
+
+ void Xf::setBiffUsedFlags( sal_uInt8 nUsedFlags )
+@@ -3150,6 +3184,12 @@ void StylesBuffer::writeCellXfToPropertySet( PropertySet& rPropSet, sal_Int32 nX
+ pXf->writeToPropertySet( rPropSet );
+ }
+
++bool StylesBuffer::hasBorder( sal_Int32 nBorderId ) const
++{
++ Border* pBorder = maBorders.get( nBorderId ).get();
++ return pBorder && pBorder->hasBorder();
++}
++
+ void StylesBuffer::writeStyleXfToPropertySet( PropertySet& rPropSet, sal_Int32 nXfId ) const
+ {
+ if( Xf* pXf = maStyleXfs.get( nXfId ).get() )
diff --git a/patches/dev300/calc-xls-import-slanted-border-sc.diff b/patches/dev300/calc-xls-import-slanted-border-sc.diff
new file mode 100644
index 0000000..7e78270
--- /dev/null
+++ b/patches/dev300/calc-xls-import-slanted-border-sc.diff
@@ -0,0 +1,77 @@
+diff --git sc/source/filter/excel/xistyle.cxx sc/source/filter/excel/xistyle.cxx
+index 9f38dda..ac5e956 100644
+--- sc/source/filter/excel/xistyle.cxx
++++ sc/source/filter/excel/xistyle.cxx
+@@ -765,7 +765,6 @@ void XclImpCellAlign::FillToItemSet( SfxItemSet& rItemSet, const XclImpFont* pFo
+ sal_uInt8 nXclRot = (mnOrient == EXC_ORIENT_NONE) ? mnRotation : XclTools::GetXclRotFromOrient( mnOrient );
+ bool bStacked = (nXclRot == EXC_ROT_STACKED);
+ ScfTools::PutItem( rItemSet, SfxBoolItem( ATTR_STACKED, bStacked ), bSkipPoolDefs );
+- ScfTools::PutItem( rItemSet, SvxRotateModeItem( SVX_ROTATE_MODE_STANDARD, ATTR_ROTATE_MODE ), bSkipPoolDefs );
+ // set an angle in the range from -90 to 90 degrees
+ sal_Int32 nAngle = XclTools::GetScRotation( nXclRot, 0 );
+ ScfTools::PutItem( rItemSet, SfxInt32Item( ATTR_ROTATE_VALUE, nAngle ), bSkipPoolDefs );
+@@ -863,6 +862,15 @@ void XclImpCellBorder::FillFromCF8( sal_uInt16 nLineStyle, sal_uInt32 nLineColor
+ mbDiagUsed = false;
+ }
+
++bool XclImpCellBorder::HasAnyOuterBorder() const
++{
++ return
++ (mbLeftUsed && (mnLeftLine != EXC_LINE_NONE)) ||
++ (mbRightUsed && (mnRightLine != EXC_LINE_NONE)) ||
++ (mbTopUsed && (mnTopLine != EXC_LINE_NONE)) ||
++ (mbBottomUsed && (mnBottomLine != EXC_LINE_NONE));
++}
++
+ namespace {
+
+ /** Converts the passed line style to a SvxBorderLine, or returns false, if style is "no line". */
+@@ -1244,11 +1252,12 @@ const ScPatternAttr& XclImpXF::CreatePattern( bool bSkipPoolDefs )
+ // create new pattern attribute set
+ mpPattern.reset( new ScPatternAttr( GetDoc().GetPool() ) );
+ SfxItemSet& rItemSet = mpPattern->GetItemSet();
++ XclImpXF* pParentXF = IsCellXF() ? GetXFBuffer().GetXF( mnParent ) : 0;
+
+ // parent cell style
+ if( IsCellXF() )
+ {
+- if( XclImpXF* pParentXF = GetXFBuffer().GetXF( mnParent ) )
++ if( pParentXF )
+ {
+ mpStyleSheet = pParentXF->CreateStyleSheet();
+ UpdateUsedFlags( *pParentXF );
+@@ -1292,6 +1301,20 @@ const ScPatternAttr& XclImpXF::CreatePattern( bool bSkipPoolDefs )
+ maArea.mnPattern != EXC_PATT_SOLID);
+ }
+
++ /* #i38709# Decide which rotation reference mode to use. If any outer
++ border line of the cell is set (either explicitly or via cell style),
++ and the cell contents are rotated, set rotation reference to bottom of
++ cell. This causes the borders to be painted rotated with the text. */
++ if( mbAlignUsed || mbBorderUsed )
++ {
++ SvxRotateMode eRotateMode = SVX_ROTATE_MODE_STANDARD;
++ const XclImpCellAlign* pAlign = mbAlignUsed ? &maAlignment : (pParentXF ? &pParentXF->maAlignment : 0);
++ const XclImpCellBorder* pBorder = mbBorderUsed ? &maBorder : (pParentXF ? &pParentXF->maBorder : 0);
++ if( pAlign && pBorder && (0 < pAlign->mnRotation) && (pAlign->mnRotation <= 180) && pBorder->HasAnyOuterBorder() )
++ eRotateMode = SVX_ROTATE_MODE_BOTTOM;
++ ScfTools::PutItem( rItemSet, SvxRotateModeItem( eRotateMode, ATTR_ROTATE_MODE ), bSkipPoolDefs );
++ }
++
+ return *mpPattern;
+ }
+
+diff --git sc/source/filter/inc/xistyle.hxx sc/source/filter/inc/xistyle.hxx
+index 91d9265..92ceca6 100644
+--- sc/source/filter/inc/xistyle.hxx
++++ sc/source/filter/inc/xistyle.hxx
+@@ -321,6 +321,9 @@ struct XclImpCellBorder : public XclCellBorder
+ /** Fills this struct with BIFF8 CF (conditional format) record data. */
+ void FillFromCF8( sal_uInt16 nLineStyle, sal_uInt32 nLineColor, sal_uInt32 nFlags );
+
++ /** Returns true, if any of the outer border lines is visible. */
++ bool HasAnyOuterBorder() const;
++
+ /** Inserts a box item representing this border style into the item set.
+ @param bSkipPoolDefs true = Do not put items equal to pool default; false = Put all items. */
+ void FillToItemSet(
diff --git a/patches/dev300/calc-xls-import-slanted-border.diff b/patches/dev300/calc-xls-import-slanted-border.diff
deleted file mode 100644
index 7e78270..0000000
--- a/patches/dev300/calc-xls-import-slanted-border.diff
+++ /dev/null
@@ -1,77 +0,0 @@
-diff --git sc/source/filter/excel/xistyle.cxx sc/source/filter/excel/xistyle.cxx
-index 9f38dda..ac5e956 100644
---- sc/source/filter/excel/xistyle.cxx
-+++ sc/source/filter/excel/xistyle.cxx
-@@ -765,7 +765,6 @@ void XclImpCellAlign::FillToItemSet( SfxItemSet& rItemSet, const XclImpFont* pFo
- sal_uInt8 nXclRot = (mnOrient == EXC_ORIENT_NONE) ? mnRotation : XclTools::GetXclRotFromOrient( mnOrient );
- bool bStacked = (nXclRot == EXC_ROT_STACKED);
- ScfTools::PutItem( rItemSet, SfxBoolItem( ATTR_STACKED, bStacked ), bSkipPoolDefs );
-- ScfTools::PutItem( rItemSet, SvxRotateModeItem( SVX_ROTATE_MODE_STANDARD, ATTR_ROTATE_MODE ), bSkipPoolDefs );
- // set an angle in the range from -90 to 90 degrees
- sal_Int32 nAngle = XclTools::GetScRotation( nXclRot, 0 );
- ScfTools::PutItem( rItemSet, SfxInt32Item( ATTR_ROTATE_VALUE, nAngle ), bSkipPoolDefs );
-@@ -863,6 +862,15 @@ void XclImpCellBorder::FillFromCF8( sal_uInt16 nLineStyle, sal_uInt32 nLineColor
- mbDiagUsed = false;
- }
-
-+bool XclImpCellBorder::HasAnyOuterBorder() const
-+{
-+ return
-+ (mbLeftUsed && (mnLeftLine != EXC_LINE_NONE)) ||
-+ (mbRightUsed && (mnRightLine != EXC_LINE_NONE)) ||
-+ (mbTopUsed && (mnTopLine != EXC_LINE_NONE)) ||
-+ (mbBottomUsed && (mnBottomLine != EXC_LINE_NONE));
-+}
-+
- namespace {
-
- /** Converts the passed line style to a SvxBorderLine, or returns false, if style is "no line". */
-@@ -1244,11 +1252,12 @@ const ScPatternAttr& XclImpXF::CreatePattern( bool bSkipPoolDefs )
- // create new pattern attribute set
- mpPattern.reset( new ScPatternAttr( GetDoc().GetPool() ) );
- SfxItemSet& rItemSet = mpPattern->GetItemSet();
-+ XclImpXF* pParentXF = IsCellXF() ? GetXFBuffer().GetXF( mnParent ) : 0;
-
- // parent cell style
- if( IsCellXF() )
- {
-- if( XclImpXF* pParentXF = GetXFBuffer().GetXF( mnParent ) )
-+ if( pParentXF )
- {
- mpStyleSheet = pParentXF->CreateStyleSheet();
- UpdateUsedFlags( *pParentXF );
-@@ -1292,6 +1301,20 @@ const ScPatternAttr& XclImpXF::CreatePattern( bool bSkipPoolDefs )
- maArea.mnPattern != EXC_PATT_SOLID);
- }
-
-+ /* #i38709# Decide which rotation reference mode to use. If any outer
-+ border line of the cell is set (either explicitly or via cell style),
-+ and the cell contents are rotated, set rotation reference to bottom of
-+ cell. This causes the borders to be painted rotated with the text. */
-+ if( mbAlignUsed || mbBorderUsed )
-+ {
-+ SvxRotateMode eRotateMode = SVX_ROTATE_MODE_STANDARD;
-+ const XclImpCellAlign* pAlign = mbAlignUsed ? &maAlignment : (pParentXF ? &pParentXF->maAlignment : 0);
-+ const XclImpCellBorder* pBorder = mbBorderUsed ? &maBorder : (pParentXF ? &pParentXF->maBorder : 0);
-+ if( pAlign && pBorder && (0 < pAlign->mnRotation) && (pAlign->mnRotation <= 180) && pBorder->HasAnyOuterBorder() )
-+ eRotateMode = SVX_ROTATE_MODE_BOTTOM;
-+ ScfTools::PutItem( rItemSet, SvxRotateModeItem( eRotateMode, ATTR_ROTATE_MODE ), bSkipPoolDefs );
-+ }
-+
- return *mpPattern;
- }
-
-diff --git sc/source/filter/inc/xistyle.hxx sc/source/filter/inc/xistyle.hxx
-index 91d9265..92ceca6 100644
---- sc/source/filter/inc/xistyle.hxx
-+++ sc/source/filter/inc/xistyle.hxx
-@@ -321,6 +321,9 @@ struct XclImpCellBorder : public XclCellBorder
- /** Fills this struct with BIFF8 CF (conditional format) record data. */
- void FillFromCF8( sal_uInt16 nLineStyle, sal_uInt32 nLineColor, sal_uInt32 nFlags );
-
-+ /** Returns true, if any of the outer border lines is visible. */
-+ bool HasAnyOuterBorder() const;
-+
- /** Inserts a box item representing this border style into the item set.
- @param bSkipPoolDefs true = Do not put items equal to pool default; false = Put all items. */
- void FillToItemSet(
More information about the ooo-build-commit
mailing list