summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorBayram Çiçek <mail@bayramcicek.com.tr>2021-08-16 00:31:15 +0300
committerMuhammet Kara <muhammet.kara@collabora.com>2021-08-19 12:01:51 +0200
commit966d043b631fd1e850d0eb62d657fbca8f62c033 (patch)
treedd371160afdc8aee645a0605720e45c63963cf7b /sc/source
parent55c4bfc5717c6f915e8760eec95be76813d5fce8 (diff)
tdf#143890: Show preview of diagonal borders / Calc
- in "Properties sidebar > Cell Appearance", Calc shows preview of the selected cell borders. (preview is at the bottom of "Background" text) - this feature doesn't work for diagonal borders. - diagonal borders preview is now shown with this patch. Change-Id: I9d98b045ccef5e8469cc38f08e5f14c3199d027c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120519 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx17
-rw-r--r--sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx2
2 files changed, 13 insertions, 6 deletions
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
index 188a638e7315..75cb52209942 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
@@ -258,9 +258,9 @@ void CellAppearancePropertyPanel::NotifyItemUpdate(
mbBottom = true;
if(!AllSettings::GetLayoutRTL())
- UpdateCellBorder(mbTop, mbBottom, mbLeft, mbRight, mbVer, mbHor);
+ UpdateCellBorder(mbTop, mbBottom, mbLeft, mbRight, mbVer, mbHor, mbDiagTLBR, mbDiagBLTR);
else
- UpdateCellBorder(mbTop, mbBottom, mbRight, mbLeft, mbVer, mbHor);
+ UpdateCellBorder(mbTop, mbBottom, mbRight, mbLeft, mbVer, mbHor, mbDiagTLBR, mbDiagBLTR);
if(mbLeft || mbRight || mbTop || mbBottom)
mbOuterBorder = true;
@@ -301,9 +301,9 @@ void CellAppearancePropertyPanel::NotifyItemUpdate(
bBottom = true;
if(!AllSettings::GetLayoutRTL())
- UpdateCellBorder(bTop, bBottom, bLeft, bRight, mbVer, mbHor);
+ UpdateCellBorder(bTop, bBottom, bLeft, bRight, mbVer, mbHor, mbDiagTLBR, mbDiagBLTR);
else
- UpdateCellBorder(bTop, bBottom, bRight, bLeft, mbVer, mbHor);
+ UpdateCellBorder(bTop, bBottom, bRight, bLeft, mbVer, mbHor, mbDiagTLBR, mbDiagBLTR);
if(mbVer || mbHor || bLeft || bRight || bTop || bBottom)
mbInnerBorder = true;
@@ -337,6 +337,7 @@ void CellAppearancePropertyPanel::NotifyItemUpdate(
}
}
}
+ UpdateCellBorder(mbTop, mbBottom, mbLeft, mbRight, mbVer, mbHor, mbDiagTLBR, mbDiagBLTR);
UpdateControlState();
break;
case SID_ATTR_BORDER_DIAG_BLTR:
@@ -363,6 +364,7 @@ void CellAppearancePropertyPanel::NotifyItemUpdate(
}
}
}
+ UpdateCellBorder(mbTop, mbBottom, mbLeft, mbRight, mbVer, mbHor, mbDiagTLBR, mbDiagBLTR);
UpdateControlState();
break;
}
@@ -464,7 +466,8 @@ void CellAppearancePropertyPanel::UpdateControlState()
}
}
-void CellAppearancePropertyPanel::UpdateCellBorder(bool bTop, bool bBot, bool bLeft, bool bRight, bool bVer, bool bHor)
+void CellAppearancePropertyPanel::UpdateCellBorder(bool bTop, bool bBot, bool bLeft, bool bRight,
+ bool bVer, bool bHor, bool bTLBR, bool bBLTR)
{
const Size aBmpSize = maIMGCellBorder.GetBitmapEx().GetSizePixel();
@@ -488,6 +491,10 @@ void CellAppearancePropertyPanel::UpdateCellBorder(bool bTop, bool bBot, bool bL
pVirDev->DrawLine( aVT,aVB );
if(bHor)
pVirDev->DrawLine( aHL,aHR );
+ if(bTLBR)
+ pVirDev->DrawLine( aTL,aBR );
+ if(bBLTR)
+ pVirDev->DrawLine( aBL,aTR );
mxTBCellBorder->set_item_image(SETBORDERSTYLE, pVirDev);
}
else
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
index d695df4ceb0a..412cd37e107a 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
@@ -139,7 +139,7 @@ private:
void Initialize();
void SetStyleIcon();
void UpdateControlState();
- void UpdateCellBorder(bool bTop, bool bBot, bool bLeft, bool bRight, bool bVer, bool bHor);
+ void UpdateCellBorder(bool bTop, bool bBot, bool bLeft, bool bRight, bool bVer, bool bHor, bool bTLBR, bool bBLTR);
};
} // end of namespace ::sc::sidebar