[ooo-build-commit] Branch 'ooo-build-3-1-1' - patches/dev300
Kohei Yoshida
kohei at kemper.freedesktop.org
Tue Oct 27 09:07:46 PDT 2009
patches/dev300/apply | 3
patches/dev300/calc-xls-import-slanted-border.diff | 77 +++++++++++++++++++++
2 files changed, 80 insertions(+)
New commits:
commit 11abb457f18ebc3a3c0177b923cd1c8ba53903a4
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Tue Oct 27 12:05:11 2009 -0400
Set the reference edge of a cell to bottom when importing angled text.
* patches/dev300/apply:
* patches/dev300/calc-xls-import-slanted-border.diff: When importing
cells with angled text from xls document, set the reference edge
to 'bottom' so that the borders get slanted as well.
(n#549728, i#38709)
diff --git a/patches/dev300/apply b/patches/dev300/apply
index f095b8a..57a890c 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3448,6 +3448,9 @@ calc-general-type-auto-decimal-officecfg.diff, n#541973, kohei
# Correctly encrypt zero bytes in the conditional formatting records.
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
+
[ AutoLayout ]
sd-layoutcode.diff, cocofan
offapi-layoutcode.diff, cocofan
diff --git a/patches/dev300/calc-xls-import-slanted-border.diff b/patches/dev300/calc-xls-import-slanted-border.diff
new file mode 100644
index 0000000..7e78270
--- /dev/null
+++ b/patches/dev300/calc-xls-import-slanted-border.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(
More information about the ooo-build-commit
mailing list