sc/source/filter/inc/stylesbuffer.hxx       |    7 ++++++
 sc/source/filter/oox/defaulttablestyles.cxx |    4 +++
 sc/source/filter/oox/stylesbuffer.cxx       |   29 ++++++++++++++++++++++++++++
 3 files changed, 40 insertions(+)

New commits:
commit e4c0f046fd75b766f0c1fca04c8b93ce450b1e5a
Author:     Markus Mohrhard <[email protected]>
AuthorDate: Fri Aug 8 05:55:12 2025 +0800
Commit:     Balazs Varga <[email protected]>
CommitDate: Thu Jan 29 09:27:02 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]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197966
    Tested-by: Jenkins

diff --git a/sc/source/filter/inc/stylesbuffer.hxx 
b/sc/source/filter/inc/stylesbuffer.hxx
index 3c2fa81238af..53d3eeb43d34 100644
--- a/sc/source/filter/inc/stylesbuffer.hxx
+++ b/sc/source/filter/inc/stylesbuffer.hxx
@@ -416,6 +416,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.
 
@@ -433,13 +435,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 b997fe1c74ce..ccf5c9241ef5 100644
--- a/sc/source/filter/oox/defaulttablestyles.cxx
+++ b/sc/source/filter/oox/defaulttablestyles.cxx
@@ -92,6 +92,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 225567abbe49..c9d9de57f40c 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;
 }

Reply via email to