summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-04-23 09:22:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-04-23 11:28:55 +0200
commit246ef0b8eaa86b62fb0f980d0736d97c05283266 (patch)
tree90d4f506e3645185e2e184f16855d4a9fe66cbfe /sw
parentbced98442d5e9c4b55ec6d4e5da3d549f8141359 (diff)
loplugin:singlevalfields
Change-Id: I4d7b38c90d73a00f4dbc8ad7318fe4573328ed46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166503 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx2
-rw-r--r--sw/source/ui/table/convert.cxx21
-rw-r--r--sw/source/uibase/inc/convert.hxx3
-rw-r--r--sw/source/writerfilter/rtftok/rtfcharsets.cxx2
-rw-r--r--sw/source/writerfilter/rtftok/rtfcharsets.hxx2
-rw-r--r--sw/source/writerfilter/rtftok/rtftokenizer.cxx4
6 files changed, 9 insertions, 25 deletions
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 4fc2cea421a3..ae11902beedc 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -354,7 +354,7 @@ public:
virtual void GetValues( sal_Unicode& rDelim,SwInsertTableOptions& rInsTableFlags,
SwTableAutoFormat const*& prTAFormat) override;
virtual std::unique_ptr<SwTableAutoFormat> FillAutoFormatOfIndex() const override;
- virtual void Apply() override { m_xDlg->Apply(); }
+ virtual void Apply() override {}
};
class AbstractSwInsertDBColAutoPilot_Impl : public AbstractSwInsertDBColAutoPilot
diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx
index 65a42f227892..290fff011e2b 100644
--- a/sw/source/ui/table/convert.cxx
+++ b/sw/source/ui/table/convert.cxx
@@ -102,7 +102,6 @@ SwConvertTableDlg::SwConvertTableDlg(SwView& rView, bool bToTable)
, m_nIndex(0)
, m_nDfltStylePos(0)
, m_bCoreDataChanged(false)
- , m_bSetAutoFormat(false)
, m_xTableTable(new SwTableAutoFormatTable)
, m_xTabBtn(m_xBuilder->weld_radio_button("tabs"))
, m_xSemiBtn(m_xBuilder->weld_radio_button("semicolons"))
@@ -217,14 +216,10 @@ void SwConvertTableDlg::Init()
m_xLbFormat->connect_changed(LINK(this, SwConvertTableDlg, SelFormatHdl));
- m_nIndex = 0;
- if (!m_bSetAutoFormat)
- {
- // Then the list to be expanded by the entry "- none -".
- m_xLbFormat->append_text(SwViewShell::GetShellRes()->aStrNone);
- m_nDfltStylePos = 1;
- m_nIndex = 255;
- }
+ // Then the list to be expanded by the entry "- none -".
+ m_xLbFormat->append_text(SwViewShell::GetShellRes()->aStrNone);
+ m_nDfltStylePos = 1;
+ m_nIndex = 255;
for (sal_uInt8 i = 0, nCount = static_cast<sal_uInt8>(m_xTableTable->size()); i < nCount; i++)
{
@@ -295,7 +290,6 @@ IMPL_LINK(SwConvertTableDlg, CheckHdl, weld::Toggleable&, rBtn, void)
}
m_aWndPreview.NotifyChange(rData);
- Apply();
mxTAutoFormat = FillAutoFormatOfIndex();
}
}
@@ -309,7 +303,6 @@ IMPL_LINK_NOARG(SwConvertTableDlg, SelFormatHdl, weld::TreeView&, void)
m_nIndex = nSelPos - m_nDfltStylePos;
m_aWndPreview.NotifyChange((*m_xTableTable)[m_nIndex]);
UpdateChecks((*m_xTableTable)[m_nIndex], true);
- Apply();
mxTAutoFormat = FillAutoFormatOfIndex();
}
else
@@ -330,12 +323,6 @@ IMPL_LINK_NOARG(SwConvertTableDlg, SelFormatHdl, weld::TreeView&, void)
}
}
-void SwConvertTableDlg::Apply()
-{
- if (m_bSetAutoFormat)
- m_pShell->SetTableStyle((*m_xTableTable)[m_nIndex]);
-}
-
IMPL_LINK(SwConvertTableDlg, BtnHdl, weld::Toggleable&, rButton, void)
{
if (!rButton.get_active())
diff --git a/sw/source/uibase/inc/convert.hxx b/sw/source/uibase/inc/convert.hxx
index 053702f3abc3..8b976a948bf1 100644
--- a/sw/source/uibase/inc/convert.hxx
+++ b/sw/source/uibase/inc/convert.hxx
@@ -47,7 +47,6 @@ class SwConvertTableDlg final : public SfxDialogController
sal_uInt8 m_nIndex;
sal_uInt8 m_nDfltStylePos;
bool m_bCoreDataChanged : 1;
- bool m_bSetAutoFormat : 1;
std::unique_ptr<SwTableAutoFormatTable> m_xTableTable;
std::unique_ptr<weld::RadioButton> m_xTabBtn;
@@ -96,8 +95,6 @@ public:
std::unique_ptr<SwTableAutoFormat> FillAutoFormatOfIndex() const;
- void Apply();
-
virtual ~SwConvertTableDlg() override;
};
diff --git a/sw/source/writerfilter/rtftok/rtfcharsets.cxx b/sw/source/writerfilter/rtftok/rtfcharsets.cxx
index 1b71bbb9951c..7c36534b98c2 100644
--- a/sw/source/writerfilter/rtftok/rtfcharsets.cxx
+++ b/sw/source/writerfilter/rtftok/rtfcharsets.cxx
@@ -51,7 +51,7 @@ RTFEncoding const aRTFEncodings[] = {
{ 255, 850 }, // OEM
};
-int nRTFEncodings = std::size(aRTFEncodings);
+int const nRTFEncodings = std::size(aRTFEncodings);
RTFFontNameSuffix const aRTFFontNameSuffixes[] = {
{ "Baltic", RTL_TEXTENCODING_MS_1257 }, { "CE", RTL_TEXTENCODING_MS_1250 },
diff --git a/sw/source/writerfilter/rtftok/rtfcharsets.hxx b/sw/source/writerfilter/rtftok/rtfcharsets.hxx
index 826dea271f6b..feb9a09a5bc8 100644
--- a/sw/source/writerfilter/rtftok/rtfcharsets.hxx
+++ b/sw/source/writerfilter/rtftok/rtfcharsets.hxx
@@ -18,7 +18,7 @@ struct RTFEncoding
int codepage;
};
extern RTFEncoding const aRTFEncodings[];
-extern int nRTFEncodings;
+extern int const nRTFEncodings;
/// Font name can contain special suffixes used
/// to determine encoding for given font table entry
diff --git a/sw/source/writerfilter/rtftok/rtftokenizer.cxx b/sw/source/writerfilter/rtftok/rtftokenizer.cxx
index 420c6d36f0c3..90627c8bd50a 100644
--- a/sw/source/writerfilter/rtftok/rtftokenizer.cxx
+++ b/sw/source/writerfilter/rtftok/rtftokenizer.cxx
@@ -25,9 +25,9 @@ using namespace com::sun::star;
namespace writerfilter::rtftok
{
std::unordered_map<OString, RTFSymbol> RTFTokenizer::s_aRTFControlWords;
-bool RTFTokenizer::s_bControlWordsInitialised;
+bool RTFTokenizer::s_bControlWordsInitialised = false;
std::vector<RTFMathSymbol> RTFTokenizer::s_aRTFMathControlWords;
-bool RTFTokenizer::s_bMathControlWordsSorted;
+bool RTFTokenizer::s_bMathControlWordsSorted = false;
RTFTokenizer::RTFTokenizer(RTFListener& rImport, SvStream* pInStream,
uno::Reference<task::XStatusIndicator> const& xStatusIndicator)