summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-01-15 11:15:50 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-01-15 22:14:39 +0100
commit07b224028963a3ce9c1a0401c0dc9fb4538d515e (patch)
tree1649f1bf5f1fb1e539f03f89bd95109b78024086 /cui
parentd479d1694897bdb2588f38c4d231220efb4eb229 (diff)
Related: tdf#122627 auto detect of toggle column doesn't work
so remove it and explicitly state what column contains the toggle Change-Id: I58fb12a4b8fa9eeb9c038f796e48b0aeaa0b2404 Reviewed-on: https://gerrit.libreoffice.org/66379 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/autocdlg.cxx66
-rw-r--r--cui/uiconfig/ui/acoroptionspage.ui3
-rw-r--r--cui/uiconfig/ui/applyautofmtpage.ui6
-rw-r--r--cui/uiconfig/ui/applylocalizedpage.ui9
-rw-r--r--cui/uiconfig/ui/smarttagoptionspage.ui15
5 files changed, 55 insertions, 44 deletions
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 3d177683458d..af460fbe60a3 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -206,20 +206,24 @@ VclPtr<SfxTabPage> OfaAutocorrOptionsPage::Create(TabPageParent pParent,
return VclPtr<OfaAutocorrOptionsPage>::Create(pParent, *rSet);
}
+#define CBCOL_FIRST 0
+#define CBCOL_SECOND 1
+#define CBCOL_BOTH 2
+
bool OfaAutocorrOptionsPage::FillItemSet( SfxItemSet* )
{
SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect();
ACFlags nFlags = pAutoCorrect->GetFlags();
int nPos = 0;
- pAutoCorrect->SetAutoCorrFlag(ACFlags::Autocorrect, m_xCheckLB->get_toggle(nPos++));
- pAutoCorrect->SetAutoCorrFlag(ACFlags::CapitalStartWord, m_xCheckLB->get_toggle(nPos++));
- pAutoCorrect->SetAutoCorrFlag(ACFlags::CapitalStartSentence, m_xCheckLB->get_toggle(nPos++));
- pAutoCorrect->SetAutoCorrFlag(ACFlags::ChgWeightUnderl, m_xCheckLB->get_toggle(nPos++));
- pAutoCorrect->SetAutoCorrFlag(ACFlags::SetINetAttr, m_xCheckLB->get_toggle(nPos++));
- pAutoCorrect->SetAutoCorrFlag(ACFlags::ChgToEnEmDash, m_xCheckLB->get_toggle(nPos++));
- pAutoCorrect->SetAutoCorrFlag(ACFlags::IgnoreDoubleSpace, m_xCheckLB->get_toggle(nPos++));
- pAutoCorrect->SetAutoCorrFlag(ACFlags::CorrectCapsLock, m_xCheckLB->get_toggle(nPos++));
+ pAutoCorrect->SetAutoCorrFlag(ACFlags::Autocorrect, m_xCheckLB->get_toggle(nPos++, CBCOL_FIRST));
+ pAutoCorrect->SetAutoCorrFlag(ACFlags::CapitalStartWord, m_xCheckLB->get_toggle(nPos++, CBCOL_FIRST));
+ pAutoCorrect->SetAutoCorrFlag(ACFlags::CapitalStartSentence, m_xCheckLB->get_toggle(nPos++, CBCOL_FIRST));
+ pAutoCorrect->SetAutoCorrFlag(ACFlags::ChgWeightUnderl, m_xCheckLB->get_toggle(nPos++, CBCOL_FIRST));
+ pAutoCorrect->SetAutoCorrFlag(ACFlags::SetINetAttr, m_xCheckLB->get_toggle(nPos++, CBCOL_FIRST));
+ pAutoCorrect->SetAutoCorrFlag(ACFlags::ChgToEnEmDash, m_xCheckLB->get_toggle(nPos++, CBCOL_FIRST));
+ pAutoCorrect->SetAutoCorrFlag(ACFlags::IgnoreDoubleSpace, m_xCheckLB->get_toggle(nPos++, CBCOL_FIRST));
+ pAutoCorrect->SetAutoCorrFlag(ACFlags::CorrectCapsLock, m_xCheckLB->get_toggle(nPos++, CBCOL_FIRST));
bool bReturn = nFlags != pAutoCorrect->GetFlags();
if(bReturn )
@@ -241,14 +245,10 @@ void OfaAutocorrOptionsPage::InsertEntry(const OUString& rTxt)
m_xCheckLB->insert(nullptr, -1, nullptr, nullptr, nullptr,
nullptr, nullptr, false);
const int nRow = m_xCheckLB->n_children() - 1;
- m_xCheckLB->set_toggle(nRow, false, 0);
+ m_xCheckLB->set_toggle(nRow, false, CBCOL_FIRST);
m_xCheckLB->set_text(nRow, rTxt, 1);
}
-#define CBCOL_FIRST 0
-#define CBCOL_SECOND 1
-#define CBCOL_BOTH 2
-
void OfaAutocorrOptionsPage::Reset( const SfxItemSet* )
{
SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect();
@@ -411,25 +411,25 @@ bool OfaSwAutoFmtOptionsPage::FillItemSet( SfxItemSet* )
SvxSwAutoFormatFlags *pOpt = &pAutoCorrect->GetSwFlags();
ACFlags nFlags = pAutoCorrect->GetFlags();
- bool bCheck = m_xCheckLB->get_toggle(USE_REPLACE_TABLE);
+ bool bCheck = m_xCheckLB->get_toggle(USE_REPLACE_TABLE, CBCOL_FIRST);
bModified |= pOpt->bAutoCorrect != bCheck;
pOpt->bAutoCorrect = bCheck;
pAutoCorrect->SetAutoCorrFlag(ACFlags::Autocorrect,
m_xCheckLB->get_toggle(USE_REPLACE_TABLE, CBCOL_SECOND));
- bCheck = m_xCheckLB->get_toggle(CORR_UPPER);
+ bCheck = m_xCheckLB->get_toggle(CORR_UPPER, CBCOL_FIRST);
bModified |= pOpt->bCapitalStartWord != bCheck;
pOpt->bCapitalStartWord = bCheck;
pAutoCorrect->SetAutoCorrFlag(ACFlags::CapitalStartWord,
m_xCheckLB->get_toggle(CORR_UPPER, CBCOL_SECOND));
- bCheck = m_xCheckLB->get_toggle(BEGIN_UPPER);
+ bCheck = m_xCheckLB->get_toggle(BEGIN_UPPER, CBCOL_FIRST);
bModified |= pOpt->bCapitalStartSentence != bCheck;
pOpt->bCapitalStartSentence = bCheck;
pAutoCorrect->SetAutoCorrFlag(ACFlags::CapitalStartSentence,
m_xCheckLB->get_toggle(BEGIN_UPPER, CBCOL_SECOND));
- bCheck = m_xCheckLB->get_toggle(BOLD_UNDERLINE);
+ bCheck = m_xCheckLB->get_toggle(BOLD_UNDERLINE, CBCOL_FIRST);
bModified |= pOpt->bChgWeightUnderl != bCheck;
pOpt->bChgWeightUnderl = bCheck;
pAutoCorrect->SetAutoCorrFlag(ACFlags::ChgWeightUnderl,
@@ -441,21 +441,21 @@ bool OfaSwAutoFmtOptionsPage::FillItemSet( SfxItemSet* )
pAutoCorrect->SetAutoCorrFlag(ACFlags::CorrectCapsLock,
m_xCheckLB->get_toggle(CORRECT_CAPS_LOCK, CBCOL_SECOND));
- bCheck = m_xCheckLB->get_toggle(DETECT_URL);
+ bCheck = m_xCheckLB->get_toggle(DETECT_URL, CBCOL_FIRST);
bModified |= pOpt->bSetINetAttr != bCheck;
pOpt->bSetINetAttr = bCheck;
pAutoCorrect->SetAutoCorrFlag(ACFlags::SetINetAttr,
m_xCheckLB->get_toggle(DETECT_URL, CBCOL_SECOND));
- bCheck = m_xCheckLB->get_toggle(DEL_EMPTY_NODE);
+ bCheck = m_xCheckLB->get_toggle(DEL_EMPTY_NODE, CBCOL_FIRST);
bModified |= pOpt->bDelEmptyNode != bCheck;
pOpt->bDelEmptyNode = bCheck;
- bCheck = m_xCheckLB->get_toggle(REPLACE_USER_COLL);
+ bCheck = m_xCheckLB->get_toggle(REPLACE_USER_COLL, CBCOL_FIRST);
bModified |= pOpt->bChgUserColl != bCheck;
pOpt->bChgUserColl = bCheck;
- bCheck = m_xCheckLB->get_toggle(REPLACE_BULLETS);
+ bCheck = m_xCheckLB->get_toggle(REPLACE_BULLETS, CBCOL_FIRST);
bModified |= pOpt->bChgEnumNum != bCheck;
pOpt->bChgEnumNum = bCheck;
bModified |= aBulletFont != pOpt->aBulletFont;
@@ -468,7 +468,7 @@ bool OfaSwAutoFmtOptionsPage::FillItemSet( SfxItemSet* )
pOpt->aByInputBulletFont = aByInputBulletFont;
pOpt->cByInputBullet = sByInputBulletChar[0];
- bCheck = m_xCheckLB->get_toggle(MERGE_SINGLE_LINE_PARA);
+ bCheck = m_xCheckLB->get_toggle(MERGE_SINGLE_LINE_PARA, CBCOL_FIRST);
bModified |= pOpt->bRightMargin != bCheck;
pOpt->bRightMargin = bCheck;
bModified |= nPercent != pOpt->nRightMargin;
@@ -490,20 +490,20 @@ bool OfaSwAutoFmtOptionsPage::FillItemSet( SfxItemSet* )
bModified |= pOpt->bReplaceStyles != bCheck;
pOpt->bReplaceStyles = bCheck;
- bCheck = m_xCheckLB->get_toggle(REPLACE_DASHES);
+ bCheck = m_xCheckLB->get_toggle(REPLACE_DASHES, CBCOL_FIRST);
bModified |= pOpt->bChgToEnEmDash != bCheck;
pOpt->bChgToEnEmDash = bCheck;
pAutoCorrect->SetAutoCorrFlag(ACFlags::ChgToEnEmDash,
m_xCheckLB->get_toggle(REPLACE_DASHES, CBCOL_SECOND));
- bCheck = m_xCheckLB->get_toggle(DEL_SPACES_AT_STT_END);
+ bCheck = m_xCheckLB->get_toggle(DEL_SPACES_AT_STT_END, CBCOL_FIRST);
bModified |= pOpt->bAFormatDelSpacesAtSttEnd != bCheck;
pOpt->bAFormatDelSpacesAtSttEnd = bCheck;
bCheck = m_xCheckLB->get_toggle(DEL_SPACES_AT_STT_END, CBCOL_SECOND);
bModified |= pOpt->bAFormatByInpDelSpacesAtSttEnd != bCheck;
pOpt->bAFormatByInpDelSpacesAtSttEnd = bCheck;
- bCheck = m_xCheckLB->get_toggle(DEL_SPACES_BETWEEN_LINES);
+ bCheck = m_xCheckLB->get_toggle(DEL_SPACES_BETWEEN_LINES, CBCOL_FIRST);
bModified |= pOpt->bAFormatDelSpacesBetweenLines != bCheck;
pOpt->bAFormatDelSpacesBetweenLines = bCheck;
bCheck = m_xCheckLB->get_toggle(DEL_SPACES_BETWEEN_LINES, CBCOL_SECOND);
@@ -1618,8 +1618,8 @@ bool OfaQuoteTabPage::FillItemSet( SfxItemSet* )
if (m_xCheckLB->get_visible())
{
int nPos = 0;
- pAutoCorrect->SetAutoCorrFlag(ACFlags::AddNonBrkSpace, m_xCheckLB->get_toggle(nPos++));
- pAutoCorrect->SetAutoCorrFlag(ACFlags::ChgOrdinalNumber, m_xCheckLB->get_toggle(nPos++));
+ pAutoCorrect->SetAutoCorrFlag(ACFlags::AddNonBrkSpace, m_xCheckLB->get_toggle(nPos++, CBCOL_FIRST));
+ pAutoCorrect->SetAutoCorrFlag(ACFlags::ChgOrdinalNumber, m_xCheckLB->get_toggle(nPos++, CBCOL_FIRST));
}
bool bModified = false;
@@ -1627,13 +1627,13 @@ bool OfaQuoteTabPage::FillItemSet( SfxItemSet* )
{
SvxSwAutoFormatFlags *pOpt = &pAutoCorrect->GetSwFlags();
- bool bCheck = m_xSwCheckLB->get_toggle(ADD_NONBRK_SPACE);
+ bool bCheck = m_xSwCheckLB->get_toggle(ADD_NONBRK_SPACE, CBCOL_FIRST);
bModified |= pOpt->bAddNonBrkSpace != bCheck;
pOpt->bAddNonBrkSpace = bCheck;
pAutoCorrect->SetAutoCorrFlag(ACFlags::AddNonBrkSpace,
m_xSwCheckLB->get_toggle(ADD_NONBRK_SPACE, CBCOL_SECOND));
- bCheck = m_xSwCheckLB->get_toggle(REPLACE_1ST);
+ bCheck = m_xSwCheckLB->get_toggle(REPLACE_1ST, CBCOL_FIRST);
bModified |= pOpt->bChgOrdinalNumber != bCheck;
pOpt->bChgOrdinalNumber = bCheck;
pAutoCorrect->SetAutoCorrFlag(ACFlags::ChgOrdinalNumber,
@@ -1716,8 +1716,8 @@ void OfaQuoteTabPage::Reset( const SfxItemSet* )
CreateEntry(*m_xCheckLB, sOrdinal, CBCOL_FIRST, 1);
int nPos = 0;
- m_xCheckLB->set_toggle(nPos++, bool(nFlags & ACFlags::AddNonBrkSpace));
- m_xCheckLB->set_toggle(nPos++, bool(nFlags & ACFlags::ChgOrdinalNumber));
+ m_xCheckLB->set_toggle(nPos++, bool(nFlags & ACFlags::AddNonBrkSpace), CBCOL_FIRST);
+ m_xCheckLB->set_toggle(nPos++, bool(nFlags & ACFlags::ChgOrdinalNumber), CBCOL_FIRST);
m_xCheckLB->thaw();
}
@@ -2213,7 +2213,7 @@ void OfaSmartTagOptionsTabPage::FillListBox( const SmartTagMgr& rSmartTagMgr )
nullptr, nullptr, false);
const int nRow = m_xSmartTagTypesLB->n_children() - 1;
const bool bCheck = rSmartTagMgr.IsSmartTagTypeEnabled( aSmartTagType );
- m_xSmartTagTypesLB->set_toggle(nRow, bCheck);
+ m_xSmartTagTypesLB->set_toggle(nRow, bCheck, CBCOL_FIRST);
m_xSmartTagTypesLB->set_text(nRow, aLBEntry, 1);
m_xSmartTagTypesLB->set_id(nRow, OUString::number(reinterpret_cast<sal_Int64>(new ImplSmartTagLBUserData(aSmartTagType, xRec, j))));
}
@@ -2288,7 +2288,7 @@ bool OfaSmartTagOptionsTabPage::FillItemSet( SfxItemSet* )
for (int i = 0; i < nCount; ++i)
{
const ImplSmartTagLBUserData* pUserData = reinterpret_cast<ImplSmartTagLBUserData*>(m_xSmartTagTypesLB->get_id(i).toInt64());
- const bool bChecked = m_xSmartTagTypesLB->get_toggle(i);
+ const bool bChecked = m_xSmartTagTypesLB->get_toggle(i, CBCOL_FIRST);
const bool bIsCurrentlyEnabled = pSmartTagMgr->IsSmartTagTypeEnabled( pUserData->maSmartTagType );
bModifiedSmartTagTypes = bModifiedSmartTagTypes || ( !bChecked != !bIsCurrentlyEnabled );
diff --git a/cui/uiconfig/ui/acoroptionspage.ui b/cui/uiconfig/ui/acoroptionspage.ui
index 5721b2b54b2d..9c10c2b50f58 100644
--- a/cui/uiconfig/ui/acoroptionspage.ui
+++ b/cui/uiconfig/ui/acoroptionspage.ui
@@ -10,6 +10,8 @@
<column type="gchararray"/>
<!-- column-name id -->
<column type="gchararray"/>
+ <!-- column-name checkvis1 -->
+ <column type="gboolean"/>
</columns>
</object>
<object class="GtkBox" id="AutocorrectOptionsPage">
@@ -48,6 +50,7 @@
<child>
<object class="GtkCellRendererToggle" id="cellrenderer5"/>
<attributes>
+ <attribute name="visible">3</attribute>
<attribute name="active">0</attribute>
</attributes>
</child>
diff --git a/cui/uiconfig/ui/applyautofmtpage.ui b/cui/uiconfig/ui/applyautofmtpage.ui
index 77b179a7fc96..98528c5d13c1 100644
--- a/cui/uiconfig/ui/applyautofmtpage.ui
+++ b/cui/uiconfig/ui/applyautofmtpage.ui
@@ -12,6 +12,10 @@
<column type="gchararray"/>
<!-- column-name id -->
<column type="gchararray"/>
+ <!-- column-name checkvis1 -->
+ <column type="gboolean"/>
+ <!-- column-name checkvis2 -->
+ <column type="gboolean"/>
</columns>
</object>
<object class="GtkBox" id="ApplyAutoFmtPage">
@@ -116,6 +120,7 @@
<child>
<object class="GtkCellRendererToggle" id="cellrenderer1"/>
<attributes>
+ <attribute name="visible">4</attribute>
<attribute name="active">0</attribute>
</attributes>
</child>
@@ -130,6 +135,7 @@
<child>
<object class="GtkCellRendererToggle" id="cellrenderer2"/>
<attributes>
+ <attribute name="visible">5</attribute>
<attribute name="active">1</attribute>
</attributes>
</child>
diff --git a/cui/uiconfig/ui/applylocalizedpage.ui b/cui/uiconfig/ui/applylocalizedpage.ui
index 7376e74ddfcb..705a810f58db 100644
--- a/cui/uiconfig/ui/applylocalizedpage.ui
+++ b/cui/uiconfig/ui/applylocalizedpage.ui
@@ -12,6 +12,10 @@
<column type="gchararray"/>
<!-- column-name id -->
<column type="gchararray"/>
+ <!-- column-name checkvis1 -->
+ <column type="gboolean"/>
+ <!-- column-name checkvis2 -->
+ <column type="gboolean"/>
</columns>
</object>
<object class="GtkTreeStore" id="liststore2">
@@ -22,6 +26,8 @@
<column type="gchararray"/>
<!-- column-name id -->
<column type="gchararray"/>
+ <!-- column-name checkvis1 -->
+ <column type="gboolean"/>
</columns>
</object>
<object class="GtkBox" id="ApplyLocalizedPage">
@@ -74,6 +80,7 @@
<child>
<object class="GtkCellRendererToggle" id="cellrenderer1"/>
<attributes>
+ <attribute name="visible">4</attribute>
<attribute name="active">0</attribute>
</attributes>
</child>
@@ -88,6 +95,7 @@
<child>
<object class="GtkCellRendererToggle" id="cellrenderer2"/>
<attributes>
+ <attribute name="visible">5</attribute>
<attribute name="active">1</attribute>
</attributes>
</child>
@@ -143,6 +151,7 @@
<child>
<object class="GtkCellRendererToggle" id="cellrenderer5"/>
<attributes>
+ <attribute name="visible">3</attribute>
<attribute name="active">0</attribute>
</attributes>
</child>
diff --git a/cui/uiconfig/ui/smarttagoptionspage.ui b/cui/uiconfig/ui/smarttagoptionspage.ui
index 46fe9173f07a..b4e00e16a8a7 100644
--- a/cui/uiconfig/ui/smarttagoptionspage.ui
+++ b/cui/uiconfig/ui/smarttagoptionspage.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.1 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
<object class="GtkTreeStore" id="liststore2">
@@ -10,6 +10,8 @@
<column type="gchararray"/>
<!-- column-name id -->
<column type="gchararray"/>
+ <!-- column-name checkvis1 -->
+ <column type="gboolean"/>
</columns>
</object>
<object class="GtkGrid" id="SmartTagOptionsPage">
@@ -38,8 +40,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -77,8 +77,6 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -110,6 +108,7 @@
<child>
<object class="GtkCellRendererToggle" id="cellrenderer5"/>
<attributes>
+ <attribute name="activatable">3</attribute>
<attribute name="active">0</attribute>
</attributes>
</child>
@@ -133,8 +132,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -155,16 +152,12 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>