summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-04-04 14:30:03 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-04-06 19:53:00 +0200
commit5c32ba63163d9556ff89782a8074924cdf9dc554 (patch)
tree66acbb3b4c298c9f0cbff75f9e36bf3d759b7a0f /sw
parent6f31c63e35abef03e6f938bbddc8778b70a62d43 (diff)
weld OTableSubscriptionPage
Change-Id: I55c23448480384c9a7d78cd55550bb4812ebde72 Reviewed-on: https://gerrit.libreoffice.org/70314 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/config/optload.cxx19
-rw-r--r--sw/source/ui/index/cnttab.cxx29
-rw-r--r--sw/uiconfig/swriter/ui/assignstylesdialog.ui22
-rw-r--r--sw/uiconfig/swriter/ui/optcaptionpage.ui2
-rw-r--r--sw/uiconfig/swriter/ui/tocindexpage.ui2
5 files changed, 56 insertions, 18 deletions
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 97833bf3d64b..e219d1d6b665 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -491,6 +491,7 @@ SwCaptionOptPage::SwCaptionOptPage(TabPageParent pParent, const SfxItemSet& rSet
std::vector<int> aWidths;
aWidths.push_back(m_xCheckLB->get_checkbox_column_width());
+ aWidths.push_back(m_xCheckLB->get_checkbox_column_width());
m_xCheckLB->set_column_fixed_widths(aWidths);
SwStyleNameMapper::FillUIName(RES_POOLCOLL_LABEL_ABB, m_sIllustration);
@@ -590,7 +591,7 @@ bool SwCaptionOptPage::FillItemSet( SfxItemSet* )
int nCheckCount = 0;
for (int i = 0, nCount = m_xCheckLB->n_children(); i < nCount; ++i)
{
- if (m_xCheckLB->get_toggle(i, 0))
+ if (m_xCheckLB->get_toggle(i, 0) == TRISTATE_TRUE)
++nCheckCount;
InsCaptionOpt* pData = reinterpret_cast<InsCaptionOpt*>(m_xCheckLB->get_id(i).toInt64());
bRet |= pModOpt->SetCapOption(bHTMLMode, pData);
@@ -618,15 +619,15 @@ void SwCaptionOptPage::Reset( const SfxItemSet* rSet)
// Writer objects
int nPos = 0;
m_xCheckLB->append();
- m_xCheckLB->set_toggle(nPos, false, 0);
+ m_xCheckLB->set_toggle(nPos, TRISTATE_FALSE, 0);
m_xCheckLB->set_text(nPos, m_sSWTable, 1);
SetOptions(nPos++, TABLE_CAP);
m_xCheckLB->append();
- m_xCheckLB->set_toggle(nPos, false, 0);
+ m_xCheckLB->set_toggle(nPos, TRISTATE_FALSE, 0);
m_xCheckLB->set_text(nPos, m_sSWFrame, 1);
SetOptions(nPos++, FRAME_CAP);
m_xCheckLB->append();
- m_xCheckLB->set_toggle(nPos, false, 0);
+ m_xCheckLB->set_toggle(nPos, TRISTATE_FALSE, 0);
m_xCheckLB->set_text(nPos, m_sSWGraphic, 1);
SetOptions(nPos++, GRAPHIC_CAP);
@@ -651,7 +652,7 @@ void SwCaptionOptPage::Reset( const SfxItemSet* rSet)
// don't show product version
sClass = sClass.replaceFirst( sComplete, sWithoutVersion );
m_xCheckLB->append();
- m_xCheckLB->set_toggle(nPos, false, 0);
+ m_xCheckLB->set_toggle(nPos, TRISTATE_FALSE, 0);
m_xCheckLB->set_text(nPos, sClass, 1);
SetOptions( nPos++, OLE_CAP, &rOleId );
}
@@ -671,7 +672,7 @@ void SwCaptionOptPage::SetOptions(const sal_uLong nPos,
{
InsCaptionOpt* pIns = new InsCaptionOpt(*pOpt);
m_xCheckLB->set_id(nPos, OUString::number(reinterpret_cast<sal_Int64>(pIns)));
- m_xCheckLB->set_toggle(nPos, pOpt->UseCaption(), 0);
+ m_xCheckLB->set_toggle(nPos, pOpt->UseCaption() ? TRISTATE_TRUE : TRISTATE_FALSE, 0);
}
else
{
@@ -693,7 +694,7 @@ void SwCaptionOptPage::UpdateEntry(int nSelEntry)
{
if (nSelEntry != -1)
{
- bool bChecked = m_xCheckLB->get_toggle(nSelEntry, 0);
+ bool bChecked = m_xCheckLB->get_toggle(nSelEntry, 0) == TRISTATE_TRUE;
m_xSettingsGroup->set_sensitive(bChecked);
bool bNumSep = bChecked && m_xLbCaptionOrder->get_active() == 1;
@@ -816,7 +817,7 @@ void SwCaptionOptPage::SaveEntry(int nEntry)
InsCaptionOpt* pOpt = reinterpret_cast<InsCaptionOpt*>(m_xCheckLB->get_id(nEntry).toInt64());
- pOpt->UseCaption() = m_xCheckLB->get_toggle(nEntry, 0);
+ pOpt->UseCaption() = m_xCheckLB->get_toggle(nEntry, 0) == TRISTATE_TRUE;
const OUString aName(m_xCategoryBox->get_active_text());
if (aName == m_sNone)
pOpt->SetCategory("");
@@ -881,7 +882,7 @@ IMPL_LINK(SwCaptionOptPage, OrderHdl, weld::ComboBox&, rBox, void)
bool bChecked = false;
if (nSelEntry != -1)
{
- bChecked = m_xCheckLB->get_toggle(nSelEntry, 0);
+ bChecked = m_xCheckLB->get_toggle(nSelEntry, 0) == TRISTATE_TRUE;
}
int nPos = rBox.get_active();
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 6790e9710be6..0208d36cd837 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -575,7 +575,10 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(weld::Window* pParent,
OUString sEntry = rStyles.getToken(0, TOX_STYLE_DELIMITER, nPos);
m_xHeaderTree->append_text(sEntry);
for (sal_uInt16 j = 0; j <= MAXLEVEL; ++j)
- m_xHeaderTree->set_toggle(nRow, i == j - 1, j + 1);
+ {
+ TriState eState = i == j - 1 ? TRISTATE_TRUE : TRISTATE_FALSE;
+ m_xHeaderTree->set_toggle(nRow, eState, j + 1);
+ }
++nRow;
} while (nPos>=0);
}
@@ -605,7 +608,10 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(weld::Window* pParent,
{
m_xHeaderTree->append_text(aName);
for (sal_uInt16 k = 0; k <= MAXLEVEL; ++k)
- m_xHeaderTree->set_toggle(nRow, k == 0, k + 1);
+ {
+ TriState eState = k == 0 ? TRISTATE_TRUE : TRISTATE_FALSE;
+ m_xHeaderTree->set_toggle(nRow, eState, k + 1);
+ }
++nRow;
}
}
@@ -635,7 +641,10 @@ IMPL_LINK(SwAddStylesDlg_Impl, TreeSizeAllocHdl, const Size&, rSize, void)
IMPL_LINK(SwAddStylesDlg_Impl, RadioToggleOnHdl, const row_col&, rRowCol, void)
{
for (sal_uInt16 i = 0; i <= MAXLEVEL; ++i)
- m_xHeaderTree->set_toggle(rRowCol.first, rRowCol.second == i + 1, i + 1);
+ {
+ TriState eState = rRowCol.second == i + 1 ? TRISTATE_TRUE : TRISTATE_FALSE;
+ m_xHeaderTree->set_toggle(rRowCol.first, eState, i + 1);
+ }
}
IMPL_LINK(SwAddStylesDlg_Impl, KeyInput, const KeyEvent&, rKEvt, bool)
@@ -668,7 +677,7 @@ IMPL_LINK_NOARG(SwAddStylesDlg_Impl, OkHdl, weld::Button&, void)
int nToggleColumn = 0;
for (sal_uInt16 j = 0; j <= MAXLEVEL; ++j)
{
- if (m_xHeaderTree->get_toggle(i, j + 1))
+ if (m_xHeaderTree->get_toggle(i, j + 1) == TRISTATE_TRUE)
{
nToggleColumn = j;
break;
@@ -696,7 +705,7 @@ IMPL_LINK(SwAddStylesDlg_Impl, LeftRightHdl, weld::Button&, rBtn, void)
int nToggleColumn = 0;
for (sal_uInt16 j = 0; j <= MAXLEVEL; ++j)
{
- if (m_xHeaderTree->get_toggle(nEntry, j + 1))
+ if (m_xHeaderTree->get_toggle(nEntry, j + 1) == TRISTATE_TRUE)
{
nToggleColumn = j;
break;
@@ -715,7 +724,9 @@ IMPL_LINK(SwAddStylesDlg_Impl, LeftRightHdl, weld::Button&, rBtn, void)
}
for (sal_uInt16 j = 0; j <= MAXLEVEL; ++j)
- m_xHeaderTree->set_toggle(nEntry, j == nToggleColumn, j + 1);
+ {
+ m_xHeaderTree->set_toggle(nEntry, j == nToggleColumn ? TRISTATE_TRUE : TRISTATE_FALSE, j + 1);
+ }
}
}
@@ -788,7 +799,7 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(TabPageParent pParent, const SfxItemSet&
{
OUString sId(OUString::number(static_cast<sal_uInt32>(RES_SRCTYPES[i].second)));
m_xFromObjCLB->append();
- m_xFromObjCLB->set_toggle(i, false, 0);
+ m_xFromObjCLB->set_toggle(i, TRISTATE_FALSE, 0);
m_xFromObjCLB->set_text(i, SwResId(RES_SRCTYPES[i].first), 1);
m_xFromObjCLB->set_id(i, sId);
}
@@ -1006,7 +1017,7 @@ void SwTOXSelectTabPage::ApplyTOXDescription()
for (int nFromObj = 0, nCount = m_xFromObjCLB->n_children(); nFromObj < nCount; ++nFromObj)
{
SwTOOElements nData = static_cast<SwTOOElements>(m_xFromObjCLB->get_id(nFromObj).toInt32());
- m_xFromObjCLB->set_toggle(nFromObj, bool(nData & nOLEData), 0);
+ m_xFromObjCLB->set_toggle(nFromObj, bool(nData & nOLEData) ? TRISTATE_TRUE : TRISTATE_FALSE, 0);
}
}
else if(TOX_AUTHORITIES == aCurType.eType)
@@ -1101,7 +1112,7 @@ void SwTOXSelectTabPage::FillTOXDescription()
SwTOOElements nOLEData = SwTOOElements::NONE;
for (int i = 0, nCount = m_xFromObjCLB->n_children(); i < nCount; ++i)
{
- if (m_xFromObjCLB->get_toggle(i, 0))
+ if (m_xFromObjCLB->get_toggle(i, 0) == TRISTATE_TRUE)
{
SwTOOElements nData = static_cast<SwTOOElements>(m_xFromObjCLB->get_id(i).toInt32());
nOLEData |= nData;
diff --git a/sw/uiconfig/swriter/ui/assignstylesdialog.ui b/sw/uiconfig/swriter/ui/assignstylesdialog.ui
index 6d4a931b6887..6a95455ab2db 100644
--- a/sw/uiconfig/swriter/ui/assignstylesdialog.ui
+++ b/sw/uiconfig/swriter/ui/assignstylesdialog.ui
@@ -62,6 +62,28 @@
<column type="gboolean"/>
<!-- column-name checkvis11 -->
<column type="gboolean"/>
+ <!-- column-name checktri1 -->
+ <column type="gboolean"/>
+ <!-- column-name checktri2 -->
+ <column type="gboolean"/>
+ <!-- column-name checktri3 -->
+ <column type="gboolean"/>
+ <!-- column-name checktri4 -->
+ <column type="gboolean"/>
+ <!-- column-name checktri5 -->
+ <column type="gboolean"/>
+ <!-- column-name checktri6 -->
+ <column type="gboolean"/>
+ <!-- column-name checktri7 -->
+ <column type="gboolean"/>
+ <!-- column-name checktri8 -->
+ <column type="gboolean"/>
+ <!-- column-name checktri9 -->
+ <column type="gboolean"/>
+ <!-- column-name checktri10 -->
+ <column type="gboolean"/>
+ <!-- column-name checktri11 -->
+ <column type="gboolean"/>
</columns>
</object>
<object class="GtkDialog" id="AssignStylesDialog">
diff --git a/sw/uiconfig/swriter/ui/optcaptionpage.ui b/sw/uiconfig/swriter/ui/optcaptionpage.ui
index d56d14d554bd..a133a127c32e 100644
--- a/sw/uiconfig/swriter/ui/optcaptionpage.ui
+++ b/sw/uiconfig/swriter/ui/optcaptionpage.ui
@@ -12,6 +12,8 @@
<column type="gchararray"/>
<!-- column-name checkvis1 -->
<column type="gboolean"/>
+ <!-- column-name checktri1 -->
+ <column type="gboolean"/>
</columns>
</object>
<object class="GtkBox" id="OptCaptionPage">
diff --git a/sw/uiconfig/swriter/ui/tocindexpage.ui b/sw/uiconfig/swriter/ui/tocindexpage.ui
index 4d37bd9f0216..6a9d2e24927f 100644
--- a/sw/uiconfig/swriter/ui/tocindexpage.ui
+++ b/sw/uiconfig/swriter/ui/tocindexpage.ui
@@ -47,6 +47,8 @@
<column type="gchararray"/>
<!-- column-name checkvis1 -->
<column type="gboolean"/>
+ <!-- column-name checktri1 -->
+ <column type="gboolean"/>
</columns>
</object>
<object class="GtkBox" id="TocIndexPage">