sc/inc/tablestyle.hxx | 68 +++++++++++++++------------- sc/source/filter/inc/stylesbuffer.hxx | 7 ++ sc/source/filter/oox/defaulttablestyles.cxx | 4 + sc/source/filter/oox/stylesbuffer.cxx | 29 +++++++++++ 4 files changed, 77 insertions(+), 31 deletions(-)
New commits: commit 4dcb7c0f1ce03f0b9f62435fd8805f51f57db319 Author: Markus Mohrhard <[email protected]> AuthorDate: Mon Aug 11 01:21:08 2025 +0800 Commit: Balazs Varga <[email protected]> CommitDate: Wed Jan 7 17:11:00 2026 +0100 don't apply banded row/col formatting to subtotal row Change-Id: Id82036246e808e9e556c5f2d04ff6611716dc9c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193671 Reviewed-by: Andras Timar <[email protected]> Tested-by: Andras Timar <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196739 Reviewed-by: Balazs Varga <[email protected]> Tested-by: Balazs Varga <[email protected]> diff --git a/sc/inc/tablestyle.hxx b/sc/inc/tablestyle.hxx index 9c1fb387d81f..01a06c6f9fa6 100644 --- a/sc/inc/tablestyle.hxx +++ b/sc/inc/tablestyle.hxx @@ -118,42 +118,48 @@ public: return pPoolItem; } - if (pParam->mbRowStripes && nRowIndex >= 0) + if (!bHasTotal || aRange.aEnd.Row() != nRow) { - sal_Int32 nTotalRowStripPattern = mnFirstRowStripeSize + mnSecondRowStripeSize; - bool bFirstRowStripe = (nRowIndex % nTotalRowStripPattern) < mnFirstRowStripeSize; - if (mpSecondRowStripePattern && !bFirstRowStripe) + if (pParam->mbRowStripes && nRowIndex >= 0) { - const T* pPoolItem = GetItemFromPattern(mpSecondRowStripePattern.get(), nWhich); - if (pPoolItem) - return pPoolItem; + sal_Int32 nTotalRowStripPattern = mnFirstRowStripeSize + mnSecondRowStripeSize; + bool bFirstRowStripe = (nRowIndex % nTotalRowStripPattern) < mnFirstRowStripeSize; + if (mpSecondRowStripePattern && !bFirstRowStripe) + { + const T* pPoolItem = GetItemFromPattern(mpSecondRowStripePattern.get(), nWhich); + if (pPoolItem) + return pPoolItem; + } + + if (mpFirstRowStripePattern && bFirstRowStripe) + { + const T* pPoolItem = GetItemFromPattern(mpFirstRowStripePattern.get(), nWhich); + if (pPoolItem) + return pPoolItem; + } } - if (mpFirstRowStripePattern && bFirstRowStripe) + if (pParam->mbColumnStripes) { - const T* pPoolItem = GetItemFromPattern(mpFirstRowStripePattern.get(), nWhich); - if (pPoolItem) - return pPoolItem; - } - } - - if (pParam->mbColumnStripes) - { - SCCOL nRelativeCol = nCol - aRange.aStart.Col(); - sal_Int32 nTotalColStripePattern = mnFirstColStripeSize + mnSecondColStripeSize; - bool bFirstColStripe = (nRelativeCol % nTotalColStripePattern) < mnFirstColStripeSize; - if (mpSecondColumnStripePattern && !bFirstColStripe) - { - const T* pPoolItem = GetItemFromPattern(mpSecondColumnStripePattern.get(), nWhich); - if (pPoolItem) - return pPoolItem; - } - - if (mpFirstColumnStripePattern && bFirstColStripe) - { - const T* pPoolItem = GetItemFromPattern(mpFirstColumnStripePattern.get(), nWhich); - if (pPoolItem) - return pPoolItem; + SCCOL nRelativeCol = nCol - aRange.aStart.Col(); + sal_Int32 nTotalColStripePattern = mnFirstColStripeSize + mnSecondColStripeSize; + bool bFirstColStripe + = (nRelativeCol % nTotalColStripePattern) < mnFirstColStripeSize; + if (mpSecondColumnStripePattern && !bFirstColStripe) + { + const T* pPoolItem + = GetItemFromPattern(mpSecondColumnStripePattern.get(), nWhich); + if (pPoolItem) + return pPoolItem; + } + + if (mpFirstColumnStripePattern && bFirstColStripe) + { + const T* pPoolItem + = GetItemFromPattern(mpFirstColumnStripePattern.get(), nWhich); + if (pPoolItem) + return pPoolItem; + } } } commit ff869b4533398c881b38f5ed5ecad8d22637c47b Author: Markus Mohrhard <[email protected]> AuthorDate: Fri Aug 8 05:55:12 2025 +0800 Commit: Balazs Varga <[email protected]> CommitDate: Wed Jan 7 17:10:47 2026 +0100 support vertical and horizontal dxf borders Change-Id: I4903ec947da4545f8fe173436b904be3e0526c09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193670 Tested-by: Andras Timar <[email protected]> Reviewed-by: Andras Timar <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196738 Tested-by: Balazs Varga <[email protected]> Reviewed-by: Balazs Varga <[email protected]> diff --git a/sc/source/filter/inc/stylesbuffer.hxx b/sc/source/filter/inc/stylesbuffer.hxx index 2d6245b3938a..8afef4cd41f0 100644 --- a/sc/source/filter/inc/stylesbuffer.hxx +++ b/sc/source/filter/inc/stylesbuffer.hxx @@ -415,6 +415,8 @@ struct BorderModel BorderLineModel maTop; /// Top line format. BorderLineModel maBottom; /// Bottom line format. BorderLineModel maDiagonal; /// Diagonal line format. + BorderLineModel maVertical; /// Vertical line format. + BorderLineModel maHorizontal; /// Horizontal line format. bool mbDiagTLtoBR; /// True = top-left to bottom-right on. bool mbDiagBLtoTR; /// True = bottom-left to top-right on. @@ -432,13 +434,18 @@ struct ApiBorderData ApiBorderLine maRight; /// Right line format ApiBorderLine maTop; /// Top line format ApiBorderLine maBottom; /// Bottom line format + ApiBorderLine maVertical; /// Vertical line format + ApiBorderLine maHorizontal; /// Horizontal line format model::ComplexColor maComplexColorLeft; model::ComplexColor maComplexColorRight; model::ComplexColor maComplexColorTop; model::ComplexColor maComplexColorBottom; + model::ComplexColor maComplexColorVertical; + model::ComplexColor maComplexColorHorizontal; 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. + bool mbVertHorz; /// True = vert/horz line format used. bool mbDiagUsed; /// True = diagonal line format used. explicit ApiBorderData(); diff --git a/sc/source/filter/oox/defaulttablestyles.cxx b/sc/source/filter/oox/defaulttablestyles.cxx index 4bf970a0ded0..918b49549182 100644 --- a/sc/source/filter/oox/defaulttablestyles.cxx +++ b/sc/source/filter/oox/defaulttablestyles.cxx @@ -90,6 +90,10 @@ void DefaultOOXMLTableStyles::importBorders() importBorderElement(xBorder, XLS_TOKEN(left), rBorderInfo.nLeftId); if (rBorderInfo.nRightId >= 0) importBorderElement(xBorder, XLS_TOKEN(right), rBorderInfo.nRightId); + if (rBorderInfo.nVerticalId >= 0) + importBorderElement(xBorder, XLS_TOKEN(vertical), rBorderInfo.nVerticalId); + if (rBorderInfo.nHorizontalId >= 0) + importBorderElement(xBorder, XLS_TOKEN(horizontal), rBorderInfo.nHorizontalId); maBorders.push_back(xBorder); } diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index afc9dfcdd889..a34af294b113 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -1492,6 +1492,8 @@ BorderModel::BorderModel( bool bDxf ) : maTop( bDxf ), maBottom( bDxf ), maDiagonal( bDxf ), + maVertical( bDxf ), + maHorizontal( bDxf ), mbDiagTLtoBR( false ), mbDiagBLtoTR( false ) { @@ -1499,6 +1501,7 @@ BorderModel::BorderModel( bool bDxf ) : ApiBorderData::ApiBorderData() : mbBorderUsed( false ), + mbVertHorz( false ), mbDiagUsed( false ) { } @@ -1599,16 +1602,21 @@ void Border::finalizeImport( bool bRTL ) maApiData.mbBorderUsed = maModel.maLeft.mbUsed || maModel.maRight.mbUsed || maModel.maTop.mbUsed || maModel.maBottom.mbUsed; maApiData.mbDiagUsed = maModel.maDiagonal.mbUsed; + maApiData.mbVertHorz = maModel.maVertical.mbUsed || maModel.maHorizontal.mbUsed; convertBorderLine( maApiData.maLeft, maModel.maLeft ); convertBorderLine( maApiData.maRight, maModel.maRight ); convertBorderLine( maApiData.maTop, maModel.maTop ); convertBorderLine( maApiData.maBottom, maModel.maBottom ); + convertBorderLine( maApiData.maVertical, maModel.maVertical ); + convertBorderLine( maApiData.maHorizontal, maModel.maHorizontal ); maApiData.maComplexColorLeft = maModel.maLeft.maColor.createComplexColor(getBaseFilter().getGraphicHelper(), -1); maApiData.maComplexColorRight = maModel.maRight.maColor.createComplexColor(getBaseFilter().getGraphicHelper(), -1); maApiData.maComplexColorTop = maModel.maTop.maColor.createComplexColor(getBaseFilter().getGraphicHelper(), -1); maApiData.maComplexColorBottom = maModel.maBottom.maColor.createComplexColor(getBaseFilter().getGraphicHelper(), -1); + maApiData.maComplexColorVertical = maModel.maVertical.maColor.createComplexColor(getBaseFilter().getGraphicHelper(), -1); + maApiData.maComplexColorHorizontal = maModel.maHorizontal.maColor.createComplexColor(getBaseFilter().getGraphicHelper(), -1); if( maModel.mbDiagTLtoBR ) convertBorderLine( maApiData.maTLtoBR, maModel.maDiagonal ); @@ -1618,6 +1626,25 @@ void Border::finalizeImport( bool bRTL ) void Border::fillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs ) const { + if (maApiData.mbVertHorz) + { + SvxBoxInfoItem aBoxInfoItem(ATTR_BORDER_INNER); + editeng::SvxBorderLine aLine; + + if (SvxBoxItem::LineToSvxLine(maApiData.maVertical, aLine, false)) + { + aLine.setComplexColor(maApiData.maComplexColorVertical); + aBoxInfoItem.SetLine(&aLine, SvxBoxInfoItemLine::VERT); + } + if (SvxBoxItem::LineToSvxLine(maApiData.maHorizontal, aLine, false)) + { + aLine.setComplexColor(maApiData.maComplexColorHorizontal); + aBoxInfoItem.SetLine(&aLine, SvxBoxInfoItemLine::HORI); + } + + ScfTools::PutItem( rItemSet, aBoxInfoItem, bSkipPoolDefs ); + + } if( maApiData.mbBorderUsed ) { SvxBoxItem aBoxItem( ATTR_BORDER ); @@ -1674,6 +1701,8 @@ BorderLineModel* Border::getBorderLine( sal_Int32 nElement ) case XLS_TOKEN( top ): return &maModel.maTop; case XLS_TOKEN( bottom ): return &maModel.maBottom; case XLS_TOKEN( diagonal ): return &maModel.maDiagonal; + case XLS_TOKEN( vertical ): return &maModel.maVertical; + case XLS_TOKEN( horizontal ): return &maModel.maHorizontal; } return nullptr; }
