summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2024-10-19 18:43:02 +0200
committerJulien Nabet <serval2412@yahoo.fr>2024-10-22 17:14:02 +0200
commitb2d35dfe19aec40d34f1a2cca0a83ef4cef23a7d (patch)
tree45fa8f8e039b204def759057397915348ec1fbde /svx
parentc8371b5f1a84191d38185820915f0d93741df1fe (diff)
tdf#163284: Diagonal/criss-cross borders for tables is only implemented in Calc
Change-Id: I645fd2a6fafb2607d94607599366d9442b4423fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175199 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
Diffstat (limited to 'svx')
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx20
1 files changed, 13 insertions, 7 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 6cab2fac0af4..4380fbc2fe6c 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -485,6 +485,7 @@ private:
std::vector<std::pair<BitmapEx, OUString>> aImgVec;
bool bParagraphMode;
bool m_bIsWriter;
+ bool m_bIsCalc;
void InitImageList();
void CalcSizeValueSet();
@@ -2471,11 +2472,16 @@ SvxFrameWindow_Impl::SvxFrameWindow_Impl(SvxFrameToolBoxControl* pControl, weld:
, mxFrameSetWin(new weld::CustomWeld(*m_xBuilder, u"valueset"_ustr, *mxFrameSet))
, bParagraphMode(false)
, m_bIsWriter(false)
+ , m_bIsCalc(false)
{
// check whether the document is Writer or not
+ // check also if it's Calc or not
if (Reference<lang::XServiceInfo> xSI{ m_xFrame->getController()->getModel(), UNO_QUERY })
+ {
m_bIsWriter = xSI->supportsService(u"com.sun.star.text.TextDocument"_ustr);
+ m_bIsCalc = xSI->supportsService(u"com.sun.star.sheet.SpreadsheetDocument"_ustr);
+ }
mxFrameSet->SetStyle(WB_ITEMBORDER | WB_DOUBLEBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT);
AddStatusListener(u".uno:BorderReducedMode"_ustr);
@@ -2495,14 +2501,14 @@ SvxFrameWindow_Impl::SvxFrameWindow_Impl(SvxFrameToolBoxControl* pControl, weld:
// diagonal borders available only for Calc.
// Therefore, Calc uses 10 border types while
// Writer uses 8 of them - for a single cell.
- for ( i=1; i < (m_bIsWriter ? 9 : 11); i++ )
+ for ( i=1; i < (m_bIsCalc ? 11 : 9); i++ )
mxFrameSet->InsertItem(i, Image(aImgVec[i-1].first), aImgVec[i-1].second);
//bParagraphMode should have been set in StateChanged
if ( !bParagraphMode )
// when multiple cell selected:
// Writer has 12 border types and Calc has 15 of them.
- for ( i = (m_bIsWriter ? 9 : 11); i < (m_bIsWriter ? 13 : 16); i++ )
+ for ( i = (m_bIsCalc ? 11 : 9); i < (m_bIsCalc ? 16 : 13); i++ )
mxFrameSet->InsertItem(i, Image(aImgVec[i-1].first), aImgVec[i-1].second);
// adjust frame column for Writer
@@ -2568,7 +2574,7 @@ IMPL_LINK_NOARG(SvxFrameWindow_Impl, SelectHdl, ValueSet*, void)
// nSel has 15 cases which means 15 border
// types for Calc. But Writer uses only 12
// of them - when diagonal borders excluded.
- if (m_bIsWriter)
+ if (!m_bIsCalc)
{
// add appropriate increments
// to match the correct borders.
@@ -2735,7 +2741,7 @@ void SvxFrameWindow_Impl::statusChanged( const css::frame::FeatureStateEvent& rE
return;
// set 12 border types for Writer, otherwise 15 for Calc.
- bool bTableMode = ( mxFrameSet->GetItemCount() == static_cast<size_t>(m_bIsWriter ? 12 : 15) );
+ bool bTableMode = ( mxFrameSet->GetItemCount() == static_cast<size_t>(m_bIsCalc ? 15 : 12) );
bool bResize = false;
if ( bTableMode && bParagraphMode )
@@ -2769,10 +2775,10 @@ void SvxFrameWindow_Impl::CalcSizeValueSet()
void SvxFrameWindow_Impl::InitImageList()
{
- if (m_bIsWriter)
+ if (!m_bIsCalc)
{
- // Writer-specific aImgVec.
- // Since Writer doesn't have diagonal borders,
+ // not Writer/Impress/Draw-specific aImgVec.
+ // Since they don't have diagonal borders,
// we have to use 12 border types here.
aImgVec = {
{BitmapEx(RID_SVXBMP_FRAME1), SvxResId(RID_SVXSTR_TABLE_PRESET_NONE)},